oak. here's the code. (i changed to ++). the files handles are just where i am reading the DNs from.
while (<XCH0S>) { @array = split(",", $_); $array[2] =~ tr/A-Z/a-z/; chomp $array[2]; $xch0{$array[2]}++; } while (<XCH3S>) { @array2 = split(",", $_); $array2[2] =~ tr/A-Z/a-z/; chomp $array2[2]; if (!defined $xch0{$array2[2]}) { print "DN of extra record is: $array2[2]"; } else { next; } }

i tested this against your hash implementation and i got these benchies:
Benchmark: timing 10000 iterations of my code, their code... my code: 1 wallclock secs ( 0.92 usr + 0.06 sys = 0.98 CPU) @ 10 +193.68/s (n=10000) their code: 0 wallclock secs ( 0.13 usr + 0.05 sys = 0.18 CPU) @ 55 +555.56/s (n=10000) (warning: too few iterations for a reliable count) C:\network>cmp2.pl Benchmark: timing 110000 iterations of my code, their code... my code: 3 wallclock secs ( 1.97 usr + 0.51 sys = 2.48 CPU) @ 44 +301.25/s (n=110000) their code: 2 wallclock secs ( 1.63 usr + 0.37 sys = 2.00 CPU) @ 54 +917.62/s (n=110000) C:\network>cmp2.pl Benchmark: timing 1000000 iterations of my code, their code... my code: 16 wallclock secs (11.07 usr + 4.80 sys = 15.86 CPU) @ 63 +043.75/s (n=1000000) their code: 18 wallclock secs (13.78 usr + 4.59 sys = 18.37 CPU) @ 54 +445.47/s (n=1000000) C:\network>cmp2.pl Benchmark: timing 2000000 iterations of my code, their code... my code: 33 wallclock secs (21.50 usr + 9.36 sys = 30.86 CPU) @ 64 +800.41/s (n=2000000) their code: 40 wallclock secs (28.05 usr + 8.83 sys = 36.88 CPU) @ 54 +226.99/s (n=2000000)


UPDATE: thank you node=tachyon for pointing out those typos - working from two different versions - sorry for the confusion.


humbly,
novitiate

"...goodnight you princes of main(e)"  --The Cider House Rules

In reply to Re: Re: using hash uniqueness to find the odd man by novitiate
in thread using hash uniqueness to find the odd man by novitiate

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.