Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: newlines in regular expressions

by Crian (Chaplain)
on Dec 07, 2004 at 10:18 UTC ( #412874=note: print w/ replies, xml ) Need Help??


in reply to newlines in regular expressions

Perhaps it could be useful (in case that these lines are not really empty because they contain whitespace) to use a script like this:

while (<>) { print unless m~^\s*\n$~; }

This is surely not the most elegant solution, but it should do the task.


Comment on Re: newlines in regular expressions
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2015-07-04 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls