in reply to Tie::File to create a Hash?

You don't want Tie::File, you want to use DBFile or BerkelyDB to create the hash-on-disk of the first file. You'd then read the second line by line and extract the path and use exists $tied_hash_on_disk{ $path } to check if you should print the line or not.