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

Jay Hannah jhannah at omnihotels.com
Thu Jul 6 08:53:54 PDT 2006


I just pastebot'd this to IRC and they recommended I try tie'ing the
hash. So I'm deep in the bowels of 'perldoc perltie' unless someone
saves me. :)

j


----
I have an object that happens to be a hashref (bless {}). Somewhere in
my 3000 lines of code a key is getting set in my object that should
never be set ({outbound}->{INBOUND}). I tried finding it the old
fashioned way, log trapping before and after every possible line I could
see that could possibly errantly autovivify that key into my object, but
I can't find it.

(There happens to be only one instance of my class in existance at any
one time, if that helps.)

I'm very familiar with perl -d and with Carp. I tried all of this in the
debugger with no luck:

   b (exists \$self->{outbound}->{INBOUND})
   b (exists \$mux->{outbound}->{INBOUND})
   b (exists \$_[0]->{outbound}->{INBOUND})
   b (exists $self->{outbound}->{INBOUND})
   b (exists $mux->{outbound}->{INBOUND})
   b (exists $_[0]->{outbound}->{INBOUND})

It shoots right past wherever that key is getting set and dies on my
Carp line...

Any suggestions on tracking down where the key springs into existance?
This object is a little weird so I don't have an explicit manipulator
method for this particular key.

Thanks,

j


More information about the Omaha-pm mailing list