Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: reading files in @ARGV doesn't return expected output

by Cristoforo (Curate)
on Jun 26, 2017 at 23:53 UTC ( [id://1193648]=note: print w/replies, xml ) Need Help??


in reply to reading files in @ARGV doesn't return expected output

## problem: prints all columns from specified files but ignores the $nextUnless specification - why?
The reason for this is that the line number $. doesn't reset for all the files (in @ARGV) unless you close ARGV at the end of each file.

You need to add this line as the last line in your 'while' loop'

close ARGV if eof;

UPDATE: This only addresses a small part of the problem. Looking at your code above, why are you opening a file (and not use it), then push that file to '@ARGV'?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-19 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found