in reply to Move along, nothing to see here . . .

If you have 5.14 (or 5.13.2 ) you could use the /r flag
my $old = 'cat'; my $new = $old =~ s/.+/dog/r; ## $old still 'cat' ## $new is 'dog'