Problems? Is your data what you think it is? | |
PerlMonks |
Why is "odd number of elements in hash assignment" warning and not error?by Dallaylaen (Chaplain) |
on Feb 18, 2015 at 13:25 UTC ( [id://1117094]=perlquestion: print w/replies, xml ) | Need Help?? |
Dallaylaen has asked for the wisdom of the Perl Monks concerning the following question: Hello dear esteemed monks, This has probably been asked before, but my google-fu cannot get through numerous "I have a warning, what should I do"-type questions. So I dare to ask: Why does "Odd number of elements in hash assignment" condition cause a warning and not error? Here are some reasons which may cause this warning:
I wonder which of the abovementioned is a "shoddy but still valid programming practice" and not a coding error, plain and simple? To make matters worse, if the missing hash value comes (well, doesn't come) in the middle of assignment, it causes the values and keys to change places. But maybe there are still some reasons to keep this warning a warning? I would like to see what I'm missing. Of course, I can use warnings FATAL => "all"; or just FATAL => "misc"; (here's another WTF - why "misc" category and not, say, "hash"/"odd"?!?!). Still I don't (fortunately) write ALL the code I have to deal with.
Back to
Seekers of Perl Wisdom
|
|