Thread Listenaufräumen (Elemente entfernen) (6 answers)
Opened by jan99 at 2014-03-17 18:45

murphy
 2014-03-18 00:07
#174220 #174220
User since
2004-07-19
1776 Artikel
HausmeisterIn
[Homepage]
user image
Dafür kann man eigentlich einfach CPAN: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.

View full thread Listenaufräumen (Elemente entfernen)