Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: O, the horrors of references and complex data structures

by CiceroLove (Monk)
on Feb 06, 2001 at 02:04 UTC ( #56592=note: print w/replies, xml ) Need Help??


in reply to O, the horrors of references and complex data structures

I know I am new at all of this but couldn't you just undef(globHash); before you start your next iteration? CiceroLove

Replies are listed 'Best First'.
Re: Re: O, the horrors of references and complex data structures
by goldclaw (Scribe) on Feb 06, 2001 at 08:28 UTC
    Nop, that undef's the hash, so the reference he keep in AoH points to a now undef'ed hash. He somehow need to disasociate the %globalHash name with the actual hash. Basically two ways of doing that if he wants to keep %globalHash truly global; using local or messing around with glob's

    sunw287 ~ > perl -e '%globalHash=(one=>"two"); $ref=\%globalHash; unde +f(%globalHash); print join("\n",keys %{$ref})' sunw287 ~ >

    goldclaw

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2021-06-22 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (108 votes). Check out past polls.

    Notices?