Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Return value from function

by runrig (Abbot)
on Jul 12, 2007 at 17:18 UTC ( [id://626283]=note: print w/replies, xml ) Need Help??


in reply to Return value from function

You can always Benchmark, but really just return whatever seems to make the most sense, or makes things more convenient. E.g., if you're using the result to pass to another function that accepts a reference, then pass back a reference. If you are returning two arrays, then you'll have to return references to them. If you know the arrays are huge, and this function might be called often, maybe pass back a reference anyway. Etc. I.e., don't worry about it too much.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-24 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found