in reply to Re: find common data in multiple files
in thread find common data in multiple files

Don't do this:
$result{$key} = 1; $result{$key}++;
... (In the code as written, the value can never be anything but 1.)

Sorry, that's wrong.

$ perl -E '$key = "wrong"; $result{$key} = 1; $result{$key}++; say val +ues %result'
2


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^3: find common data in multiple files
by Anonymous Monk on Dec 28, 2017 at 23:56 UTC
    "So, sue me ..." ... two!
    Nevertheless, not the increment-behavior that the programmer intended, which was the essential point. The value will always be one two.