in reply to Global effects of a local tie
If the docs in the Alias module are correct, that contradicts the way you are showing local implemented as
The docs in Alias imply that local will also restore a re-binding, e.g.# localize local $a= 42; # works like: my $saved= $a; $a= undef; $a= 42; # restore # works like $a= $saved;
If local worked by saving/restoring the slot, than this would be a natural consequence, but ties, blessing, etc. would not be preserved, and your sample code would not show what it does.local $x; *x= \$y; # point the scalar slot to alias $y #... # $x goes back to pointing to its own slot when restoring.
—John
|
|---|