Thread Sortierung eines Arrays (5 answers)
Opened by bAbbAZwack at 2008-01-23 16:07

styx-cc
 2008-01-23 16:24
#105063 #105063
User since
2006-05-20
533 Artikel
BenutzerIn

user image
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.

View full thread Sortierung eines Arrays