should do it (untested). To understand this just do 'perldoc -f sort' to read about the sort function.@new= sort { my ($a1,$a2)= split /\s+/,$a; my ($b1,$b2)= split /\s+/,$b; return($a1<=>$b1 or $a2 cmp $b2); } @old;
UPDATE: Added the much needed 'sort' key word after getting hints from almut, johngg and shmem
In reply to Re: Sorting question
by jethro
in thread Sorting question
by m.y
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |