in reply to the god awful =~

This would be a good place to use at least 'qr' (see perlop) or possibly the '/o' regex modifier (see perlre):
my $re = qr/$request/i; my $i = my $g = 0; for my $line (@array) { chomp; if ($line =~ $re) { #do stuff print $line, $email[$i]; $g++; } } continue { $i++ }