Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: remove single blank lines?

by Roy Johnson (Monsignor)
on Dec 08, 2003 at 22:44 UTC ( [id://313288]=note: print w/replies, xml ) Need Help??


in reply to remove single blank lines?

my $blank_lines = 0; while (<>) { if ($_ eq "\n") { ++$blank_lines } else { print "\n" x $blank_lines if $blank_lines != 1; print; $blank_lines = 0; } }

The PerlMonk tr/// Advocate

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found