in reply to Re^2: no reaction on string replace
in thread no reaction on string replace

Yeah, on the DOS or UNIX command line, the "-pi.bak -e" options have the effect of considerably simplifying the syntax for modifying a text file.

If you want to write a real script, it is slightly more complicated, those simplifications no longer apply.

Within a Perl script, you would need to do something like this;

#!/usr/bin/perl; use strict; use warnings; my $file_in = shift; open my $FH, "<", $file_in or die "cannot open $file_in $!"; while (<$FH>) { s/test/replace/g; print; }

The above might still be considered simplistic, it is just giving an idea. Please don't hesitate to ask if you need further information.