This is interesting. You called this an inplace edit, but it sounds a lot like it is srill a transfer. Otherwise there would be no need for any backup extension. This sounds essentially like an optomistic save, assuming that the procedure will finish gracefully.I think that if you examine the guts of the function, you will still see that it reads from the original and writes to a different file under the surface.
Joseph Dave K wrote: > ActiveState docs suggest you can: > perl -pi '.orig' -e 's/bar/baz/' fileA to specify the .orig suffix but > That did not work for me. > perl -pi.bak -e 's/bar/baz/' fileA does! Thanks John > "John W. Krahn" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Dave K wrote: > > > > > > perl -pi -e 's/foo/bar/' my_file.txt > > > is supposed to do an inplace edit of my_file.txt, looping over each > line, > > > replacing foo with bar. Instead it merely stomps my_file.txt, > effectively > > > erasing it. Any body know why? > > > Perl for cygwin, WinNt is the environment. > > > > Yes, this is a known problem with the -i switch on Windows. You have to > > include a file extention or it won't work. > > > > perl -pi.bak -e 's/foo/bar/' my_file.txt > > > > > > John > > -- > > use Perl; > > program > > fulfillment > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]