![]() |
|
"be consistent" | |
PerlMonks |
Re: skipping the first line of a fileby johngg (Canon) |
on Jun 12, 2009 at 20:55 UTC ( #771095=note: print w/replies, xml ) | Need Help?? |
Skipping the header in a for loop (implied with a statement modifier) is quite flexible as you can skip one, two or many lines with equal facility. It also has the advantage that the scalar receiving the readline only exists within the loop.
I hope this is of interest. Cheers, JohnGG Update: Fixed typo. Update 2: ikegami has pointed out that this code is invalid and explained why so don't do this.
In Section
Seekers of Perl Wisdom
|
|