in reply to Why is "odd number of elements in hash assignment" warning and not error?

It's a runtime check and doesn't necessarily mean that your program will break (still a hash, the last value will simply be undef )

IOW it's not a fatal problem!

But you are free to turn it personally into FATAL.

update

But I have to admit that I'd like to see more compile time checking.

Cheers Rolf

PS: Je suis Charlie!

Replies are listed 'Best First'.
Re^2: Why is "odd number of elements in hash assignment" warning and not error?
by Dallaylaen (Chaplain) on Feb 19, 2015 at 19:35 UTC

    Sure, I can fatalize some warnings. The problem is, there are a lot of different warnings under this misc group, caused by various conditions.

    Search for W misc in perldoc perldiag was an enlightening reading, and I had a good laugh reproducing some of those beasts. Most of those conditions do look like a loaded gun pointed at a foot, but not all.

      > there are a lot of different warnings under this misc group,

      just overwrite warn or die in %SIG according to your needs.

      > Most of those conditions do look like a loaded gun pointed at a foot, but not all.

      You know I love criticizing Perl, its part of my mentality to openly discuss room for improvements. Call me an anti fan boy.

      But whenever I try to get used to supposedly better designed languages (JS, Python, Ruby, ...) I'm instantly stumbling over something weird.

      And the answer I normally get after asking "why" is "yeah for historical reasons we had to do it like this and can't change it now"

      Misc is a good point, please send a feature request via Perlbug

      Cheers Rolf

      PS: Je suis Charlie!