in reply to match text files

Something like this might work:

#!/usr/bin/perl use strict; use warnings; my $fileOne = $ARGV[0]; my $fileTwo = $ARGV[1]; my $x = 0; my $count = 0; open (my $one, "<", $fileOne); while (<$one>) { $count += 1; } open ($one, "<", $fileOne); open (my $two, "<", $fileTwo); open (my $out, ">", "outputfile.txt"); for ($x = 0; $x < $count; $x += 1) { my $lineOne = <$one>; my $lineTwo = <$two>; print $out "$lineOne" if $lineOne eq $lineTwo; }