in reply to sorting and array by [2]

Thanks to everyone. Japhy, I used your example:
@info = function to read input ; for (sort third_field @info) { print "Record: $_"; } sub third_field { my $x = (split ' ', $a)[2]; my $y = (split ' ', $b)[2]; $y <=> $x; }
I tried a sample similar to that but I had
$a0 = $a -> [2]
instead of
$x = (split ' ', $a)[2];
Thanks!!!