sub foo { my ($s) = @_; # String copied here before 5.20 $s =~ s/.//s; # String copied here since 5.20 } foo($str); # No copying here.