Hey all...

I want to use groupings, (TEST), and replacement
variables, $1, $2, etc, in a replacement regex, but
the replacement is built into a variable. Like so:

#!/usr/bin/perl

my $replace = "urgent \$1";
my $string = "This is a TEST";
$string = s/(TEST)/$replace/gi;
print $string;

It outputs
This is a urgent $1

Instead of
This is a urgent TEST

Any ideas?
Thnx!
J


                
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to