Thread Sortierung eines Arrays
(5 answers)
Opened by bAbbAZwack at 2008-01-23 16:07
Holla,
Code (perl): (dl
)
1 2 3 4 5 6 perl -wle' my $x = {name => "abc", id => 1}; my $y = {name => "bcd", id => 2}; push(my @files, $y, $x); @files = sort {$a->{'name'} cmp $b->{'name'}} @files; print map {$_->{'name'}} @files;' Pörl.
|