in reply to Re^2: RFC: List::Extract
in thread RFC: List::Extract
my ($success, $failure) = part { /^ERR/ } <LOG>;
It follows the "grep" convention: modifications to $_ effect both the source and the results, as I verified with a test script:
use List::Part; my @candidates = qw( !britney !paris bettie patti ); my ($hot, $not) = part { s{^!}{} } @candidates; print "hot: ", Dumper( $hot ), "\n"; print "not: ", Dumper( $not ), "\n"; print "stuff: ", Dumper( \@candidates ), "\n";
|
|---|