http://www.perlmonks.org?node_id=964125


in reply to Indexing two large text files

ok, you can put those lines into temp file and after indexing over you can replace file1 with temp file. For example:

While<file1> { $f1=$_; While<file1> { $f2= $_; if($f1 eq $f2) { print TF "$f2\n"; } } print TF "$f1\n"; } close TF; open F_1,"file1.txt"; while(<F_1>) { print F_1 "$_\n"; } close F_1;