personel.pm: package personel; use Data::Dumper; sub sortAge { $b->[1] <=> $a->[1]; } return 1; #### #under test.pl @age = ( @f1 = (amy,35), @f2=(bill,55), @f3=(george,28), @f4=(jason,71)); @age = sort personal::sortAge(\@age); #### @age = sort sortAge(@age); #### @age = ( @f4=(jason, 71), @f2=(bill, 55), @f1=(amy, 35), @f3=(george, 28)) #### my @array = caller; ${$"{array}::b"}->[1] <=> ${$"{array}::a"}->[1]