Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by merlyn (Sage)
on Mar 19, 2001 at 23:59 UTC ( #65523=note: print w/ replies, xml ) Need Help??


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

OK, one other twisted way:

my @data = do { my @copy = @ARGV; local $/; map { shift @copy, map /(.*\n?)/g, $_ } <>; };

-- Randal L. Schwartz, Perl hacker


Comment on Re: How do I read the files in @ARGV one by one
Download Code
Re^2: How do I read the files in @ARGV one by one
by denishowe (Acolyte) on Oct 29, 2014 at 11:43 UTC

    Make sure you don't do what I just did:

    my @ARGV = $file;

    The my creates a new, local @ARGV which is not what you want. Doh!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-07-05 10:43 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 (61 votes), past polls