in reply to Can perl do...?

($foo = "this $foo") =~ s/a/b/; This is a perfectly legitimate expression, which seems to be what nashdj wants to do.

From perlop:
The string specified with =~ must be scalar variable, an array element, a hash element, or an assignment to one of those, i.e., an lvalue.
my %japh = qw(J Just A Another P Perl H Hacker); ($_ = 'J A P H') =~ s/(\w)/$japh{$1}/g; print;
Hmm...I swear sean's reply wasn't there a moment ago. Darn temporal displacement again. Anyway, he's right and so am I. Vote for his.