my @pats = ( qr/fo*/, qr/ba./, qr/w+3/ ); while (<>) { for my $pat (@pats) { print if /$pat/; } }