use Benchmark qw(cmpthese); sub x_shift { while(@_) { my $a = shift; } } sub x_copy1 { for(my $i = 0; $i < $#_; $i++) { my $a = $_[$i]; } } sub x_copy2 { my $end = $#_; for(my $i = 0; $i < $end; $i++) { my $a = $_[$i]; } } my @args = (1 .. 100); cmpthese(1000000, { x_shift => 'x_shift(@args)', x_copy1 => 'x_copy1(@args)', x_copy2 => 'x_copy2(@args)' });