go ahead... be a heretic | |
PerlMonks |
Re: Reference is experimentalby davido (Cardinal) |
on Oct 20, 2016 at 15:35 UTC ( [id://1174383]=note: print w/replies, xml ) | Need Help?? |
Certainly by now you've discovered it, but you have an additional bug:
Since nothing is ever shifted off of @ARGV, the loop will continue almost forever. $counter will increment past the last element in @ARGV, so $filename will start being undef after a few iterations, but you aren't checking the return value of open to ever know that you're failing to open files. Meanwhile you'll keep pushing empty arrayrefs onto @AoA until the system bogs down under the burden of the memory leak. After fixing that consider also using the 3-arg version of open, and checking for open success. Dave
In Section
Seekers of Perl Wisdom
|
|