foreach (@recs){ @rec = split /:/ or next; push(@goodrecs, @rec) if ($this =~ /$that/); etc .... }