Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regexp for blank lines

by qq (Hermit)
on Dec 14, 2004 at 09:37 UTC ( [id://414647]=note: print w/replies, xml ) Need Help??


in reply to regexp for blank lines

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"

qq

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://414647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-03-19 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found