By the way, I looked around on CPAN again for something like
"extract". The closest I've found is List::Part, which
takes a list and subdivides into two according to a given
critereon.
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";
|