in reply to Shift versus Sanity
These days, I tend to use @_ exclusively. However, there's one circumstance when shift wins: optional arguments. How about the classic get-and-set method for an accessor method of a scalar data item:
However, as a general rule for optional arguments, I tend to use a named parameter scheme, passing in key=>value pairs cast internally to a hash.sub foo { my $self = shift; @_ ? ($self->{foo} = shift) : $self->{foo}; }
&blah( foo=>2, bar=>'Fred');
In Section
Meditations