Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Re: Hash references moving between modules

by scain (Curate)
on Jan 10, 2003 at 18:47 UTC ( #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.


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
    I noticed that a while after I wrote it. I guess I'm too used to using ->.. I think thats more readable than $$ ..

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://225908]
[Corion]: Lady_Aleena: Hehe ;-D
[Lady_Aleena]: Corion, it was PerlMonks who kept pushing me to get Linux, so now I know some of the commands to use in word play.
[Corion]: Lady_Aleena: :-D
[Lady_Aleena]: Corion, so do you think the gods would be open to taking over Cookies should I disappear for too long a time?
[Corion]: Lady_Aleena: Yes, I think so, but maybe someone else might also take care of the cookies ;)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-04-26 08:34 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (471 votes). Check out past polls.