in reply to In-place editing of files (was: general perl question)

OK first as an aside if you want to do this on the command line look at -i and -p see perldoc perlrun -i means edit the file in place and -p means loop over all the lines in the file soo:
perl -pi '.orig' -e 's/SPONGE/WIBBLE/' FILE
Will do the search and replace SPONGE for WIBBLE on file FILE, write the changes back, while saving the original file as FILE.orig. See perlrun for more info.

UPDATE
Could you please try and name your nodes with care. General Perl question will not help someone else looking for the same answer as you. It is a good question but a more carefully worded question would have really increased the value of the node.
--

Zigster

Replies are listed 'Best First'.
Specific perl question, requiring a specific title (00001)
by frankus (Priest) on Apr 24, 2001 at 15:07 UTC

    Um I don't think this is being run from the command line, but a script the only flags you can't use in a script IIRC is -M and -m. The script finds all files ending in .bak and processes them.

    ++ for the node naming chastisement though. ;-)

    --
    
    Brother Frankus.