Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Is it better to return a hash of hashes or a reference to a hash of hashes?

by Russ (Deacon)
on Mar 05, 2002 at 20:04 UTC ( #149488=note: print w/replies, xml ) Need Help??


in reply to Is it better to return a hash of hashes or a reference to a hash of hashes?

In the final analysis, it is up to you. One of the strengths of Perl is how it allows the programmer to work efficiently. The computer usually works efficiently, too, but the programmer's efficiency comes first.

So, if you decide it is better/easier/simpler to return an "expensive" data structure (rather than forcing your caller to dereference it later), then go right ahead! Unless you are doing something really "out there" (and I could give you some examples I have tried and discarded ;-) Perl will take good care of you.

  • Comment on Re: Is it better to return a hash of hashes or a reference to a hash of hashes?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2022-05-22 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?