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 's//x/g
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 t
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.
---
> "Raj" == Raj Karadakal <[EMAIL PROTECTED]> writes:
Raj> Hi,
Raj>I 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
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//$0/' `ls -1`
>
> Will replace