my $string = "A"; my $command = '$string =~ s/A/B/'; eval $command; print $string; #B