in reply to How to sort an array
my $fieldtosort = 9; # person, for now. my @data = <DATA>; my @sorted = map { $_->[0] } sort sortf map { [$_, split /\|/ ] } @data; print @sorted; # sort by $fieldtosort sub sortf { $a->[$fieldtosort] cmp $b->[$fieldtosort]; } __DATA__ id|projname|status|submitdt|assign_dt|total|complete_dt|person|dept|cl +osed_dt
|
---|