in reply to thoughts on learning perl basics
my @unsorted = ("A","B","C",9,"B","B","AAA","D",4,"EE","BBB",55,"BBBB","CCC",55,"BBDB +","BBB","JJ","ZZZZZZ","A blue flamingo doesn't have spots"); my %tmp; $tmp{$_} = length $_ for @unsorted; my @sorted = { $tmp{$a} <=> $tmp{$b} or $a cmp $b } keys %tmp;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RE: thoughts on learning perl basics
by Zaxo (Archbishop) on Jun 16, 2001 at 13:12 UTC |