> 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. -daveThread Previous