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.use strict; use warnings; my @recs = ("a11:b21:c34", "d32:e32:", ":g02:i6", "k92:l9:m22"); my @good_recs = grep { (split/:/,$_)[1] =~ /2/ } @recs;
-enlil
In reply to Re: grep fields
by Enlil
in thread grep fields
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |