in reply to Non-destructive string substitution
my $foo = 'foofoofoo'; print map {s/foo/bar/g; $_} ($foo); [download]
-Mark