in reply to Inplace Editing

From the first Camel book, page 253, "Substituting strings in many files":
 
perl -pi.bak -e 's/OLDSTRING/NEWSTRING/g' FILELIST

 

 
Ooohhh, Rob no beer function well without!

Replies are listed 'Best First'.
Re: Re: Inplace Editing
by clemburg (Curate) on Aug 21, 2001 at 21:41 UTC

    Unfortunately, on Win32 platforms the shell does not expand wildcards in FILELIST like on Unix platforms, therefore you need to use something like this there:

    > perl -MFile::DosGlob -i.bak -pe "BEGIN {@ARGV=glob(join ' ', @ARGV)} + s/foo/bar/g" *.txt *.bak

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com