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.
In reply to Re: backreferencing fails in a search and replace with a hash
by moritz
in thread backreferencing fails in a search and replace with a hash
by tonyz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |