Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(jeffa) Re: How do I read the files in @ARGV one by one

by jeffa (Chancellor)
on Mar 19, 2001 at 20:58 UTC ( #65457=note: print w/ replies, xml ) Need Help??


in reply to How do I read the files in @ARGV one by one

Personally, I prefer to just open a filehandle:

use IO::File; my %files; foreach my $name (@ARGV) { my $file = IO::File->new($name) or next; # print error message her +e, etc. my @lines = <$file>; $files{$name} = \@lines; $file->close; }

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--


Comment on (jeffa) Re: How do I read the files in @ARGV one by one
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://65457]
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: (6)
As of 2014-10-26 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls