> Why does this segment not work properly?
> 
> $match = "cat(\d+)";
> $replace = "\1dog";
> $_ = "cat15";
> s/$match/$replace/g;
> print $_;  # prints -->  \1dog
> 
> Any ideas?

Try replacing the "\1dog" with '${1}dog' in the line where you define
$replace. That should solve your problem.

 -dave



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to