in reply to Predefined Sort
For sorting in numeric reverse order:foreach $element (@dports) { $count_hash{$element}++; } foreach $key (@predefined) { print "$key\n" x $count_hash{$key} if $count_hash{$key}; }
my @sorted = sort {$b <=> $a} @dports;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Predefined Sort
by kyle (Abbot) on Jun 20, 2008 at 16:40 UTC | |
by Fletch (Bishop) on Jun 20, 2008 at 17:34 UTC | |
by kyle (Abbot) on Jun 20, 2008 at 17:47 UTC | |
by krusty (Hermit) on Jun 20, 2008 at 17:25 UTC | |
by kyle (Abbot) on Jun 20, 2008 at 17:36 UTC |