Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Perl - Unique Numbers

by flexvault (Monsignor)
on Oct 19, 2015 at 13:58 UTC ( [id://1145323] : note . print w/replies, xml ) Need Help??

in reply to Perl - Unique Numbers

Dear johngg and dsheroh,

I do not usually critique the answers of other monks ( unless I think it is wrong :-), since thanks to Perl we have many ways of doing the same thing. When I stated 'OP', I was referring to:

OP Original Poster The author of the top level node of the thread in which it appears.
My confusion is that johngg was critiquing my answer to the Original Poster (OP) and I didn't even look at the answer johngg supplied. When I used the word 'trivial', I was referring to the OP's problem and script and not to any monk's comments.

As for my use of 'exists', I benchmarked on Perl 5.12.2 that 'exists' was faster at checking keys than working on the values of the keys ( $h{$key}++; ). In johngg script, the way he uses the incrementing in his script, it may be faster.

Let's not have a flame war over my mis-understanding!

Best Regards...Ed

"Well done is better than well said." - Benjamin Franklin