in reply to grep fields

I believe what you are asking for is something very similar to this:
use strict; use warnings; my @recs = ("a11:b21:c34", "d32:e32:", ":g02:i6", "k92:l9:m22"); my @good_recs = grep { (split/:/,$_)[1] =~ /2/ } @recs;
Where it will split the record, based on the second field, and see if it contains a 2, and if it does push the whole record unmodified record @good_recs.

-enlil