Beyond the qw() problem that has already been noted, your logic is a bit odd:
foreach $pat (@patterns) {
if ( /$pat[1]/ && /$pat[2]/) {
print "theselines";
if ( /$pat[1]/ && /$pat[3]/) {
print "theselines";
if ( /$pat[1]/ && /$pat[4]/) {
First, you're ignoring
$pat[0] altogether. Then, you're using a non-existent element
$pat[4]. And you're manually unrolling a loop and putting it inside a loop. If all you want to do is print a line when it matches what came from stdin and matches one of several patterns, just do something like this:
chomp(my $var = <STDIN>);
$var = qr($var);
my $pattern = qr($var1|$var2|$var3);
while (<FILE>)
{
print if /$var/ && /$pattern/;
}