in reply to sorting and array by [2]
I tried a sample similar to that but I had@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; }
instead of$a0 = $a -> [2]
Thanks!!!$x = (split ' ', $a)[2];
|
|---|