in reply to Two Questions on "my"
Anyway, generally you want variables to have the smallest possible scope, so I'd go for option two.
You cannot "return an array", you always return a list (when the sub is called in list context) or a single scalar value (otherwise). If you want to return a long list efficiently, return an array reference, and never mind copying the reference. If you are worried about the memory that's being consumed by 2 scalars, you should probably be coding in assembly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Two Questions on "my"
by C_T (Scribe) on May 22, 2004 at 16:10 UTC | |
by hv (Prior) on May 22, 2004 at 18:48 UTC |