RE: modifying a file

2005-07-06 Thread Tim Johnson
There are some ways to do this, but they don't apply to all instances. Really, you're usually better off just writing your changes to a temp file and then replacing your original file. Most methods that seem to accomplish what you are asking for really just do this in the background anyway.

Re: modifying a file

2005-07-06 Thread Eliyah Kilada
Thanks Tim.. Tim Johnson wrote: There are some ways to do this, but they don't apply to all instances. Really, you're usually better off just writing your changes to a temp file and then replacing your original file. Most methods that seem to accomplish what you are asking for really just do

Re: modifying a file

2005-07-06 Thread Scott R. Godin
Eliyah Kilada wrote: Hi, is there a method to _/directly/_ make: while ( FIN) { $_ =~ s//x/g; } modify FIN?! i.e., I need to make modifications in the same file I read from. Thanks And Regards, Eliyah yeah, I do this often right at the command line: perl -pi.bak -e

Re: Modifying a file in place perl -i

2003-09-05 Thread Paul Johnson
Raj (Basavaraj) Karadakal said: Hi, I am trying to modify some file sin place usinh the -i switch of perl. In each of the files however I need to replace certain strings with file name it self. When I try the following command perl -i.orig -pe 's/NAME/$0/' `ls -1` Will replace

Re: Modifying a file in place perl -i

2003-09-05 Thread Randal L. Schwartz
Raj == Raj Karadakal [EMAIL PROTECTED] writes: Raj Hi, RajI am trying to modify some file sin place usinh the -i switch of Raj perl. In each of the files however I need to replace certain strings with Raj file name it self. Raj When I try the following command Raj perl -i.orig -pe