http://www.perlmonks.org?node_id=65523


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

Replies are listed 'Best First'.
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!