sub findandreplace { my ($string, $find, $replace) = @_; eval '$string' . " =~ s/$find/$replace/"; $string; }