Do you know where your variables are? | |
PerlMonks |
Re: Return value from functionby runrig (Abbot) |
on Jul 12, 2007 at 17:18 UTC ( [id://626283]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|