in reply to Re: Search & Replace
in thread Search & Replace

And for the paranoid and the careful: perl -pi.bak -e's/XYZ/ABC/g' thefile.name anotherfile.name which will leave behind copies of the original files with .bak appended to their names.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^3: Search & Replace
by RMGir (Prior) on Sep 16, 2002 at 12:31 UTC
    for the paranoid and the careful:

    Good advice, but don't make the same mistake I made once and run that twice to fix a typo or buglet.

    In that case, of course, the "wrong" versions generated by the first run will overwrite the .bak files.
    --
    Mike

      what about adding BEGIN{$^I=time} ?

        Interesting. But, like doing BEGIN{$|=1}, that starts to make 1-liners a bit clunky...

        This might be a good trick for another module like Simple autoflush module, though.
        --
        Mike