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 reply to Re: regexp for blank lines
by qq
in thread regexp for blank lines
by cspears
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |