Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2015-11-30 23:06 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (788 votes), past polls