in reply to sorting based on a list
Update: Me stupid! This only sorts by the first character so it won't re-order qw(zvlu zulu) correctly (and I should have added a call to lc around the substr)! Note that alfie fixed the former bug here, if you add ChemBoy's fix (<=> to cmp) to that ;-).use strict; use warnings; my $sortorder = 'azbycx'; my @list2 = qw(zulu charlie xray yankee bravo alpha); print join ',', @list2,"\n"; print join ',', sort {index($sortorder,substr($a,0,1)) <=> index($sort +order,substr($b,0,1))} @list2
--
I'd like to be able to assign to an luser
|
|---|