[oak perl] (no subject)
David B. Peterson
dave at toppledwagon.com
Wed Dec 25 21:44:53 CST 2002
>Two thoughts:
>
>1. my ( $cc = @_[0] ); doesn't compile.
> btw, you mean $_[0], or shift(@_), but not @_[0].
This was written in perl 4. I said it was old. :) Actually, I
s/local/my/ before I pasted it into the email.
$cc = $_[0] is correct.
hmmm, my example does compile on my perl. I'm not saying it's
correct, but it works on: This is perl, v5.6.0 built for darwin
maybe 5.8 is more strict (as it should be!)
>2. sort() uses magical variables $a and $b, so it's a good
> idea to stay away from them.
One would hope that a subroutine would my() the variables so as not
to stomp on mine. That being said, you are right, I should stay away
from $a and $b as not all code is written properly.
-Dave
More information about the Oakland
mailing list