the only reason why your output seems to be correct is that you are dereferencing the $vars hash-ref from the closure
Oh!
Yes, changing the variable name in the subroutine 'breaks' it as expected...now I understand why the different bits of seemingly identical code behave differently! Thanks Rolf.
$vars->{'test'}; instead of $$vars{test}
I did have $vars->{'test'}; in there at one point whilst testing it.
Why is this preferable to $$vars{test}?
In reply to Re^2: Dereferencing in blessed object
by Bod
in thread Dereferencing in blessed object
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |