Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Hash references moving between modules

by scain (Curate)
on Jan 10, 2003 at 18:47 UTC ( [id://225908]=note: print w/replies, xml ) Need Help??


in reply to Re: Hash references moving between modules
in thread Hash references moving between modules

Hmm... Well, derefrencing a hashref can be done in the way you showed up there, but it is perfectly valid to get a scalar back from a hashref this way as well:
$scalar = $$hashref{key};
and assigning into a hashref can be done in the same way:
my $hashref = {}; $$hashref{key} = $scalar;
Perhaps taking a look at References quick reference will sum it up nicely.

Thanks,

Scott
Project coordinator of the Generic Model Organism Database Project

Replies are listed 'Best First'.
Re: Re: Re: Hash references moving between modules
by castaway (Parson) on Jan 14, 2003 at 14:39 UTC
    Thanks,
    I noticed that a while after I wrote it. I guess I'm too used to using ->.. I think thats more readable than $$ ..
    C.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found