in reply to warnings under the debugger

I suppose it has to do with the scoping of the warnings module, which is block scoped (i.e. scoped to the "main" program in your case, which is just "1"). Apparently, the x ("evaluate and print expression") command of the debugger is executed in a different block/scope - at least that's my first guess without having looked too deeply into the issue...

If you use the globally scoped -w in place of -Mwarnings, you do get warnings even for x in the debugger, because you then get warnings everywhere (which might be more than you wanted to know, however...)

$ perl -w -Mstrict -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> x { foo => () } Odd number of elements in anonymous hash at (eval 5)[/usr/lib/perl5/5. +8.8/perl5db.pl:628] line 2. at (eval 5)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2 eval '($@, $!, $^E, $,, $/, $\\, $^W) = @saved;package main; $ +^D = $^D | $DB::db_stop; { foo => () }; ;' called at /usr/lib/perl5/5.8.8/perl5db.pl line 628 DB::eval called at /usr/lib/perl5/5.8.8/perl5db.pl line 3412 DB::DB called at -e line 1 0 HASH(0x65f420) 'foo' => undef

I doubt that this observation is sufficient to entitle me for a free drink of my choice - but anyway. :)