use strict; # well, not really my $screw; my @box; my @box_of_good_screws; foreach $screw (@box) { if ($screw >= "1 in." && $screw =~ /black/) { push @box_of_good_screws, $screw; } }