in reply to Re^2: this doesn't sort
in thread this doesn't sort

Inside the sort block, $a and $b are elements of @bigArray, not indexes into it.

So if @bigArray contains array refs, both $a and $b end up being an array ref. And you can dereference and index into an array with the $a->[$index] syntax.

On the other hand if you write [$a], you wrap the array ref in $a into another array ref -- not what you want.

See perlreftut and perlref for more details.

Replies are listed 'Best First'.
Re^4: this doesn't sort
by hsfrey (Beadle) on Feb 26, 2012 at 19:13 UTC
    Thanks so much!