Thread sort ??? (7 answers)
Opened by frodus at 2004-01-26 19:33

Gast Gast
 2004-01-26 19:53
#79557 #79557
hi,

ganz spontan würde ich:

Code (perl): (dl )
1
2
3
4
5
6
7
8
my %hash = ( hello => 1,
        world => 2,
        perl => 3,
        computer => 4 );

my @array = ("hello", "world", "perl", "computer");
      
my @array1 = sort { $hash{$a} <=> $hash{$b} } @array;


Also jedem Element eine eindeutige Zahl geben. Oder gabs da irgendeine Logik bei dir?

Steve

View full thread sort ???