>>>>> "PBE" == Peter B Ensch <[EMAIL PROTECTED]> writes:

  PBE> Uri Guttman wrote:
  >> 
  >> >>>>> "Y" == Yanick  <[EMAIL PROTECTED]> writes:
  >> 
  >> no one seems to have seen my earlier post on this so here it is again
  >> and it is much shorter.
  >> 
  Y> perl -pe'/\S/?($e=0):($e++and$_="")' filename
  >> perl -0777pe's/^\s*\n/\n/m'          file
  >> 

  PBE> This didn't work as is. It needs the global match modifier:
  PBE> perl -0777pe's/^\s*\n/\n/mg' <file>

well, in my first post of it i did say untested. anyhow it is much
neater than the crazy $e versions. file slurp is your friend. :)

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to