|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: About a piece of codeby olus (Curate) |
| on Aug 05, 2009 at 10:47 UTC ( #786041=note: print w/ replies, xml ) | Need Help?? |
|
m/^\n/ is a regular expression that tries to match a newline (\n) at the beggining of the line (^). If there is such a match on the current value of $_, the code jumps back to the condition on the while loop, in this case reads one more line from the file. So, this code is skipping blank lines on the file. update as Marshall correctly points, the code skips lines that start with the \n disregarding whatever comes next.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||