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