Comments on: Efficient duplication searching in UNIX and Perl http://japanlifeandreligion.com/2008/04/01/efficient-duplication-searching-in-unix-and-perl/ My life as a father, Buddhist and Japanophile. Sat, 11 Jun 2011 01:53:14 +0000 hourly 1 http://wordpress.com/ By: thrig http://japanlifeandreligion.com/2008/04/01/efficient-duplication-searching-in-unix-and-perl/#comment-1797 thrig Fri, 04 Apr 2008 01:27:05 +0000 http://nihonshukyo.wordpress.com/?p=142#comment-1797 The -n option causes Perl to loop over input, in this case the two files listed. There's actually another problem: duplicate lines in the second file will be printed. This is why your longer solution is more robust, as it clearly splits the hash building from the hash matching, while mine slaps them together. The -n option causes Perl to loop over input, in this case the two files listed. There’s actually another problem: duplicate lines in the second file will be printed. This is why your longer solution is more robust, as it clearly splits the hash building from the hash matching, while mine slaps them together.

]]>
By: Gerald Ford http://japanlifeandreligion.com/2008/04/01/efficient-duplication-searching-in-unix-and-perl/#comment-1798 Gerald Ford Thu, 03 Apr 2008 03:24:18 +0000 http://nihonshukyo.wordpress.com/?p=142#comment-1798 Ha ha ha, I hadn't thought of that. Why would that work since you're not explicitly opening either file. You and your Perl one-liners. ;) Ha ha ha, I hadn’t thought of that. Why would that work since you’re not explicitly opening either file.

You and your Perl one-liners. ;)

]]>
By: thrig http://japanlifeandreligion.com/2008/04/01/efficient-duplication-searching-in-unix-and-perl/#comment-1799 thrig Thu, 03 Apr 2008 01:57:55 +0000 http://nihonshukyo.wordpress.com/?p=142#comment-1799 Assuming no duplicates in A, the script can be optimized to: perl -nle 'print if $s{$_}++' fileA fileB :) Assuming no duplicates in A, the script can be optimized to:

perl -nle ‘print if $s{$_}++’ fileA fileB
:)

]]>