in reply to backreferencing fails in a search and replace with a hash
use String::Interpolate qw(safe_interpolate); ... $line =~ s/$key/safe_interpolate($fsr_hash{$key})/e;
(Untested). If you are sure that there are no "evil" components in the replace string you can use eval to do the work of String::Interpolate.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: backreferencing fails in a search and replace with a hash
by tonyz (Novice) on Aug 02, 2008 at 14:40 UTC |