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

Re: Re: Hash references and efficiency

by simeon2000 (Monk)
on Aug 03, 2002 at 13:26 UTC ( #187344=note: print w/replies, xml ) Need Help??

in reply to Re: Hash references and efficiency
in thread Hash references and efficiency

I've actually always coded like this:

my %hash = ( jim => 'fred', babs => 'buster' ); my $href = \%hash; print $$href{jim}, "\n";

But you're saying that the $href->{jim} syntax is preferred?

perl -e "print qq/just another perl hacker who doesn't grok japh\n/"

Replies are listed 'Best First'.
Re: Re: Re: Hash references and efficiency
by perrin (Chancellor) on Aug 03, 2002 at 18:18 UTC
    Why are you doing it like that? There's no reason to use a hashref in the above code. Use refs for complex data structures or for passing hashes and arrays back and forth between subs.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2023-03-23 17:18 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.