Perl Monk, Perl Meditation | |
PerlMonks |
Re: reading files in @ARGV doesn't return expected outputby Cristoforo (Curate) |
on Jun 26, 2017 at 23:53 UTC ( [id://1193648]=note: print w/replies, xml ) | Need Help?? |
## 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'?
In Section
Seekers of Perl Wisdom
|
|