in reply to Argument Passing, preference or performance ?

... so are the two methods relatively equal in execution time, and therefore the ultimate decision is preference of the coder?

For 99% of what I do, clarity outweights performance considerations. So for clarity, I've adopted the following conventions:

  1. For object methods, always shift $self, and use array assignment to put any remaining arguments into variables. The shift becomes a visual clue that the sub is an object method.

  2. For constructors, I always shift the package name. If I'm interested in any additional arguments, I use array assignment to put them into variables. Typically, though, any arguments are a hash to initialize an instance.

  3. For non-object methods, use array assignment.

This leads to code that looks like:

sub new { my $pkg = shift; bless { default => 1, @_ }, $pkg; # @_ might override 'default' } sub method { my $self = shift; my($shoesize) = @_; .... } my non_method { my($height, $width) = @_; ... }
Code that's consistently written is easier to read, and code that's easier to read is easier to optimize. YMMV, or course.