Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://412874]
[Your Mother]: Sorry: Jackie Earle Haley
[Eily]: Sturgeon's law Your Mother?
[Your Mother]: Network, the 70's movie? Yes. Wonderful. Though it's been 20 years. Time to do it again.
[Your Mother]: I miss the Sci-Fi authors of that era quite a lot...
[LanX]: Network (1976 film) yeah
[LanX]: yeah, we just had a discussion at work that SciFi in the 70s had more inovation
[LanX]: (movies)
[Your Mother]: Real ideas. Ideas grounded in reality as well.
[LanX]: still some good newer ones. Oblivion had a great design, Moon was well acted
[Your Mother]: Moon was mind bending and lovely and what's his nose Sam is *always* fun.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2018-03-19 15:06 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.