when a lexical variable is not written to between getting assigned from a constant and getting interpolated, replace the value in the string at compile time
example:
sub statename{ my $name = 'david'; return "hello my name is $name"; }
Wouldn't you need to add taking a ref of the var, to invalidate this optimization? Specifically for this case:
sub statename { my $name = 'david'; ${\$name} = 'liz'; return "hello, my name is $name"; }
Liz