Loop through a text file line by line

M

Michele Dondi

I said: "If you replace <DATA> with <> you can read from STDIN."
You said: "Not exactly. ..."
[snip]
If you replace <DATA> with <> you can read from STDIN, provided that
@ARGV is empty. If there is anything in @ARGV, the items will be
interpreted as file names and <> will read from them instead.

While this is a better approximation to the truth(TM) than what the OP
wrote, if we want to be really fussy it's not _entirely_ exact: try

perl -pe '' - -

arguably @ARGV is not empty.
Without qualifiers, your statement implied that <> always reads from
STDIN, and that is not exactly true.

Indeed.


Michele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top