in reply to Re: Non-destructive string substitution
in thread Non-destructive string substitution

this thread is old, I know, but I did the test and $foo is not modified, here the code i wrote

my $s = "hi, how are you?"; my $s2 = ($s =~ s/,.*//gr); print "$s2 \n$s\n";
__OUTPUT__ hi hi, how are you?
hop this helps :)