my( $filename, $arg1, $arg2 ) = @ARGV; open IN, '<', $filename or die; my @contents = ; close IN; @contents = grep !/^$arg1,$arg2,/, @contents; open OUT, '>', $filename or die; print OUT @contents; close OUT;