in reply to Question on use of 'my'
There's a more compact third form which does it all in one line,
(with the oblig firework about $a and $b sacred to sort).sub function { my ($a,$b,$c,$d) = (1,2,3,4); }
All of them are functionally equivalent, perhaps differing a mite in how they are optimized.
There are two schools about where to declare. The C school puts declarations right after their scope is opened. That is necessary in C, and people used to that like having all the variables listed in one place. The other way is to postpone until you have enough information to declare and initialize at the same time.
It is largely a matter of style. Choose one you like and stick with it.
Update: Fletch++, good point!
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Question on use of 'my'
by Fletch (Bishop) on May 14, 2004 at 03:26 UTC |