Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Dereferencing a reference to a typeglob?

by Athanasius (Archbishop)
on Oct 29, 2016 at 03:50 UTC ( [id://1174919]=note: print w/replies, xml ) Need Help??


in reply to Dereferencing a reference to a typeglob?

Lexical variables (those declared with my) are not stored in the symbol table. For that, you need a package global, and three two levels of dereferencing:

13:45 >perl -Mstrict -wE "our $x = 25; my $rx = \*x; say $$rx;" *main::x 13:46 >perl -Mstrict -wE "our $x = 25; my $rx = \*x; say $$$rx;" 25 13:46 >

This sounds like an XY Problem. What are you really trying to do?

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1174919]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found