Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to process multiple input files?

by John M. Dlugosz (Monsignor)
on May 22, 2011 at 19:30 UTC ( #906191=note: print w/ replies, xml ) Need Help??


in reply to How to process multiple input files?

As written, the <> construct will read from each file name given on the command line, in turn. You don't need to do anything else; just list more than one file on the command line.


Comment on Re: How to process multiple input files?
Download Code
Re^2: How to process multiple input files?
by rnaeye (Pilgrim) on May 22, 2011 at 20:08 UTC

    It only processes first file in the command line.

      Ah, you are only reading once. I see what you were asking now.

      Making a while loop out of it like so:

      my $line; while (defined ($line = <>)) {
      will repeat until there are no files left.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://906191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2015-07-05 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (66 votes), past polls