in reply to Simple Search and Replace?

There is that -i switch for replacing files. Together with other switches your program could be a lot shorter:
perl -pi.bak -e 's/(^alert ip 63.251)/#$1/;'
This code makes a backup too.

Replies are listed 'Best First'.
Re: Re: Simple Search and Replace?
by draper7 (Scribe) on Mar 26, 2003 at 19:16 UTC
    Thanks to all!

    I really like the '-i' switch. Where in perldoc could you find this type of information?


    --JD
      Nevermind... I found the answer. "perldoc perlrun"!

      --JD
      perldoc perlrun.