From: "Mr. Shawn H. Corey" <[EMAIL PROTECTED]>
> On Wed, 2008-10-29 at 16:29 +0000, Taylor, Andrew (ASPIRE) wrote:
> > However, I also need to keep a track of which records in the array
> > have
> > been 'found' (so I can later identify any records that haven't).
> > 
> 
> @contains_id = grep {/$rec_id/} @array;
> @not_contains_id = grep { $_ !~ /$rec_id/ } @array;

Or you could use the List::MoreUtils::part():

use List::MoreUtils qw(part);

my ($found, $notfound) = part {!( /a/ )} qw(asd wtdfg wrt wrt cv3rcvb 
e4h dfg ae wf sdf sdfga);

print "Found: ", join(',', @$found), "\n";
print "Not Found: ", join(',', @$notfound), "\n";

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to