[Omaha.pm] Debugger (or Carp?): How can I detect the creation of a key in a hash object?

Andy Lester andy at petdance.com
Thu Jul 6 09:48:40 PDT 2006


> That specific key should never be set. My program is correctly puking
> because it exists. For the life of me, though, I can't find where that
> key is springing into existence.

Perhaps set

   $SIG{__DIE__} = \&Carp::confess;

and then sprinkle

   die if $hash{badkey};

throughout your code.  It won't find it exactly, but you can narrow  
it down.

--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance






More information about the Omaha-pm mailing list