Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: passing variables between subroutines

by revdiablo (Prior)
on Jan 16, 2006 at 13:57 UTC ( [id://523570]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^2: passing variables between subroutines
in thread passing variables between subroutines

It's best to avoid passing non-scalars around that way

I have to say I disagree with that as stated. Certainly, there are many cases where passing a reference is preferable, but it depends on the situation. My default is to pass a simple list and switch to passing references when there's a clear need. I'd even go so far as to say it's best to err on the side of not making references when they're not needed.

  • Comment on Re^3: passing variables between subroutines

Replies are listed 'Best First'.
Re^4: passing variables between subroutines
by Grygonos (Chaplain) on Jan 17, 2006 at 14:14 UTC
    So, can you give me an example of when it would not be a good idea to pass a reference to a non-scalar? I'm asking in earnest. I truly want to know.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://523570]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.