go ahead... be a heretic | |
PerlMonks |
Re^3: Throw compilation error(or warning) if duplicate keys are present in hashby rovf (Priest) |
on Nov 24, 2011 at 10:02 UTC ( [id://939840]=note: print w/replies, xml ) | Need Help?? |
It is a manually generated .pm file by the people who are not very much familiar with perl syntax. Hence I suspect that there might be a good chance of mistyping an existing key.You could get those people into assigning not to %hash, but to @hash, i.e. an array instead. Later in the program, you check @hash whether a "key" occurs twice, before assigning to %hash.
-- Ronald Fischer <ynnor@mm.st>
In Section
Seekers of Perl Wisdom
|
|