in reply to $1 in variable regex replacement string
Maybe I haven't had enough coffee today either, but is this the problem?
#!/usr/bin/perl $foo = "hello"; $f2 = '$foo'; $f3 = "$foo"; print "$f2\n"; print "$f3\n";
Running that causes this to appear:
$foo hello
The single quotes inhibit processing $1 as a variable, it's treated as a string.
Or maybe I just don't know what you want it to do? :-)
-J.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: $1 in variable regex replacement string
by tachyon (Chancellor) on Feb 12, 2003 at 19:03 UTC | |
by dvergin (Monsignor) on Feb 12, 2003 at 19:42 UTC | |
by tachyon (Chancellor) on Feb 12, 2003 at 21:12 UTC | |
Re: Re: $1 in variable regex replacement string
by dvergin (Monsignor) on Feb 12, 2003 at 19:26 UTC |