Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Return value from function

by bloonix (Monk)
on Jul 12, 2007 at 17:35 UTC ( #626286=note: print w/replies, xml ) Need Help??


in reply to Return value from function

In most times it's better to pass references between functions, otherwise it would copy the data and if the hash or array is too big it blows your memory away. The other thing is that if you know that the function manipulate the data and you need the original then you should pass a copy.

Replies are listed 'Best First'.
Re^2: Return value from function
by perlCrazy (Monk) on Jul 12, 2007 at 17:47 UTC
    Thanks for reply.
    Is this the best option ? why not pass reference then copy locally instead of returning from function directly.
    How much difference this will make and what should be the best prcatice.
    Also if checking the retrun value from calling function, in case of Hash, if we do like that if (%hash), then this will
    not work in all case. If we return ref, then we can test easily like that, if ($ref). Any suggestions or opinion ?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-01-28 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (73 votes). Check out past polls.

    Notices?