Thread Listenaufräumen (Elemente entfernen)
(6 answers)
Opened by jan99 at 2014-03-17 18:45
Dafür kann man eigentlich einfach List::MoreUtils::part nehmen:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 use 5.012; use List::MoreUtils qw(part); my $data = [qw(some stuff and so on)]; my ($data, $found) = part { /o/ } @$data; say join ' ', @$data; # prints 'stuff and' say join ' ', @$found; # prints 'some so on' When C++ is your hammer, every problem looks like your thumb.
|