in reply to Order of execution of functions in list

Well first, there is a problem with $a and $b in Perl. These are special variables used in for example the sort function. Use $x and $y instead.

I have bench-marked the shift vs array list assignment.
my $X = shift; my $Y = shift; vs my ($X,$Y) = @_; The second version is faster with more than one variable.

my ($a1, $a2) = (shift, shift);
Better is:
my ($X,$Y) = @_;

Replies are listed 'Best First'.
Re^2: Order of execution of functions in list
by vsespb (Chaplain) on Sep 16, 2013 at 08:44 UTC
    Well first, there is a problem with $a and $b in Perl
    1. there is no $a and $b in my code.
    2. it's not a problem, at least if you are not defining comparison function in same scope.
Re^2: Order of execution of functions in list
by vsespb (Chaplain) on Sep 13, 2013 at 13:29 UTC
    That was just proof-of-concept example, my original code a bit more complex and I care more about readability than performance in my particular case.