MeowChow has asked for the wisdom of the Perl Monks concerning the following question:
I set $x to '$y' instead of 'y' (which is how one would normally reference $y through $$x). $bob is left undefined, so we can deduce that the $$x isn't dereferenced twice. I've traversed the %:: main package symbol table, and it's not in there, either. Where, then, is $$x stored, and how is it dereferenced?no strict 'refs'; $y = 'bob'; $x = '$y'; $$x = 'wierd'; print $$x; # prints 'wierd' ($$x has a value) print ' - '; # print a little seperator print $bob; # prints nothing ($bob is still undefined)
Very mysterious...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Enigmatic Symbolic References
by chipmunk (Parson) on Dec 07, 2000 at 07:17 UTC | |
|
Re: Enigmatic Symbolic References
by Adam (Vicar) on Dec 07, 2000 at 07:20 UTC |