open my $text, "<$textFile>" or die "Dead"; while(<$text>){ if(/$firstString/m){ print $_; } if(/$secondString/m){ print $_; } }