for ( my $i = 0; $i <= $#alert; $i++ ) { unless(grep /$process[$i]/ , @ptable) { $alerts{"$alert[$i]"­} .= "\n$message[$i]"; } }