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 $_; } } #### $ perl foo.pl foo.pl first second my ($textFile, $firstString, $secondString) = @ARGV; my ($textFile, $firstString, $secondString) = @ARGV; if(/$firstString/m){ if(/$secondString/m){