in reply to Re^2: Stupid mistakes I repeatedly make
in thread Stupid mistakes I repeatedly make
I usually avoid shift unless I specifically need that array reduction behavior. In the context of parameter processing this is usually in OO-land when one method needs to call another with the same arguments it was given, e.g.
sub method1 { my $self = shift; ... maybe do some stuff ... $self->method2(@_); ... maybe do some more stuff ... return $something; } # or even more simply sub method2 { shift->method3(@_) }
Otherwise I always my($c,...) = @_;
--DrWhy
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
In Section
Meditations