in reply to Interesting Use for "state" Variables

When I first learned Perl I used to be annoyed that $x =~ s/.../.../ changed $x. Often I wanted both the original value and the transformed around. I thought I had no choice but this two liner. To my eyes, this is just plain confusing since $transformed isn't transformed (yet):
my $transformed=$original; $transformed =~ s/.../.../;

Then I discovered that I could keep the original and the transformed value by doing this one liner:

(my $transformed=$original) =~ s/.../.../;

Best, beth