in reply to Non-destructive string substitution

You could write a sub that would create the temp variable for you and return it:
#!/usr/bin/perl -w use strict; foreach my $str (qw(fish apple license gradual canaan)) { print sr($str,'s/([aeiou])/\u$1/g'),"\n"; } sub sr { my($in,$re)=@_; eval "\$in =~ $re;"; $@ and die "Bad regex '$re'\n"; $in; }
although a temp variable is still being created, just not explicitly.

This is probably the best you're going to be able to do (although there's probably a way to do it without eval), since doing something nondestructively means that the original must be kept intact, so there have to be two copies of the variable.