Thread Array mit Hashes sortieren und Elemente entfernen
(10 answers)
Opened by bianca at 2015-09-08 19:49 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 my @ar = ( { name => 'alpha', sorter => 2, test => 'I', }, { name => 'beta', sorter => 1, test => 'II', }, ); @ar = map{ $_->{name}, $_->{test} } sort{ $a->{sorter} <=> $b->{sorter} }@ar; # nimm nur das was brauchst print Dumper $_ for @ar; Last edited: 2015-09-09 17:26:05 +0200 (CEST) |