for my $line (@lines){ if( $Session->{'usrSystem'} )=~/$line/g; $Response->Write("Found a match! Hooray"); } #### foreach my $line (@lines) { if ( $Session->{'usrSystem'} =~ /$line/g ) { $Response->Write("Found a match! Hooray"); } }