in reply to Variable substitution
Are you running this in a shell script? Are you running this in a Python or Ruby or ?? program?
The backquotes and the double quotes mean that your perl code is first interpolated by the shell and then interpolated by perl.
You probably want something like this instead (UNTESTED):
my $find = qr/\d{2}-\d{2}-\d{4}/; my $replace = 'something else'; { local ( $^I, @ARGV ) = ( '.bak', $_ ); while ( <> ) { s|$find|$replace|g; print; } }
|
|---|