@f = ; foreach $line (@f) { @AB = split("\t", $line); @AA = sort { $a->[1] <=> $b->[1] } @AB; foreach $temp (@AA) { print "@$temp\t", "\n"; } } __DATA__ AA 34 AB 22 AC 12 #### use strict; use warnings; use diagnostics; my @f = ; foreach my $line (@f) { my @AB = split("\t", $line); my @AA = sort { $a->[1] <=> $b->[1] } @AB; foreach my $temp (@AA) { print "@$temp\t", "\n"; } } __DATA__ AA 34 AB 22 AC 12 #### Can't use string ("AA 34 ") as an ARRAY ref while "strict refs" in use at mytest.pl line 12, line 3 (#1) (F) Only hard references are allowed by "strict refs". Symbolic references are disallowed. See perlref. Uncaught exception from user code: Can't use string ("AA 34 ") as an ARRAY ref while "strict refs" in use at mytest.pl line 12, line 3. at mytest.pl line 12, line 3.