Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: Traversing variables in a namespace

by repson (Chaplain)
on Feb 06, 2001 at 12:07 UTC ( #56634=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Traversing variables in a namespace
in thread Traversing variables in a namespace

If you remember that %main:: is a hash of globs, then a simple derefence works, doesn't worry strict and allows you to get all types of vars. But you may only want scalars, and not a scalar version of almost everything.

for (keys %main::) { $val = ${ *{ $main::{$_} }{SCALAR} }; }


Comment on Re: Re: Re: Traversing variables in a namespace
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2015-07-31 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls