[Chicago-talk] Replacing consecutive newlines with a single newline

Andy_Bach at wiwb.uscourts.gov Andy_Bach at wiwb.uscourts.gov
Fri Sep 26 09:59:37 PDT 2008


Or
> This can also be written as

     perl -n -e 'print if /./'

or - fore! [1]:
     perl -p -e 'next if /^$/'

drat, no shorter.

a

[1]
http://perlgolf.sourceforge.net/

-------------------
Andy Bach
Systems Mangler
Internet: andy_bach at wiwb.uscourts.gov
Voice: (608) 261-5738 Fax: 264-5932

It is easier to write an incorrect program than understand
a correct one.
Alan Perlis  http://www.cs.yale.edu/quotes.html



More information about the Chicago-talk mailing list