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 19: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.