in reply to Regex with variables?

The only issue with using a var as the pattern (other than your missing =~ or course) is that it MAY contain regex metachars. quotemeta and its RE friends \Q and \E are your friends. Do:

$foo =~ s/\Q$find\$E/$replace/g;

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print