!/usr/local/perl-5.12.3/bin/perl use strict; use warnings; open FILE,"< mail.fil"; my @oralines=; close FILE; #print @oralines; open FILE,"; close FILE; #print @errs; my @subarray = (); foreach my $oralines(@oralines) { foreach my $errs(@errs) { push @subarray, $oralines if grep /$errs/, @oralines; } } print "@subarray \n"; This doesn't return anything! !/usr/local/perl-5.12.3/bin/perl use strict; use warnings; open FILE,"< mail.fil"; my @oralines=; close FILE; #print @oralines; open FILE,"; close FILE; #print @errs; my @subarray = (); foreach my $oralines(@oralines) { foreach my $errs(@errs) { push @subarray, $oralines if grep /$errs/, @oralines; } } print "@subarray \n";