laziness, impatience, and hubris | |
PerlMonks |
Re: regexp for blank linesby qq (Hermit) |
on Dec 14, 2004 at 09:37 UTC ( [id://414647]=note: print w/replies, xml ) | Need Help?? |
Your regex matches one or more whitespace, so it should match the whitespace between words. Changing it to /^\s+$/ anchors it at the start and end of the line, which works. Or you can use: next unless $line =~ /\S/;"next unless the line contains a non-whitespace character"
In Section
Seekers of Perl Wisdom
|
|