Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] How to remove unwanted lines from file.

Expand Messages
  • merlyn@stonehenge.com
    ... Jenda perl -pi.bak -e $_ = if /ignorestring/ sourcefile I find perl -ni.bak -e print unless /ignorestring/ sourcefile saner to read. Somehow, the
    Message 1 of 4 , May 10, 2007
    • 0 Attachment
      >>>>> "Jenda" == Jenda Krynicky <Jenda@...> writes:

      Jenda> perl -pi.bak -e "$_ = '' if /ignorestring/" sourcefile

      I find

      perl -ni.bak -e 'print unless /ignorestring/" sourcefile

      saner to read. Somehow, the idea of "print ''" seems wasteful,
      and potentially dangerous if "-l" is involved.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.