geektron has asked for the wisdom of the Perl Monks concerning the following question:

i'm finding a really strange problem -- some OO code i've written runs just fine, both from command line and via CGI. and i thought it was a bit slow, so i attacked it w/ DProf.

but w/ DProf i'm getting all sorts of strange errors, like:

[Fri Feb 16 16:55:17 2001] test.cgi: Can't use string ("HOSTNAME") as +a HASH ref while "strict refs" in use at ....
i would think that if this were a problem,  perl -c test.cgi would barf on me, but it doesn't.

and, even though i don't think it's a good idea, i added  no strict 'refs'; in the block in question, and got:

[Fri Feb 16 16:56:50 2001] test.cgi: Can't call method "probe_for_serv +ices" without a package or object reference at ...

so here's the question -- why would the script in question only barf with Devel::DProf? i know perl can figure out 'the right thing to do' . . .

and, here's the Dumper output of the object in question ( with text substitutions to protect company info )

$VAR1 = bless( { 'RO_STRING' => 'public', 'HOSTNAME' => 'boo.foo.com' }, 'Host::HostProbe' );
which is the Dumper output i'd expect from a blessed hash.

i'm stumped. . .

Replies are listed 'Best First'.
Re: errors profiling w/ Devel::DProf
by clintp (Curate) on Feb 18, 2001 at 01:25 UTC
    I've had -d:DProf cause segfaults once in a great while. Yet subsequent identical runs are not affected in any way. I've always assumed that if you're to the point of using DProf, you're expecting to see the man behind the curtain, warts and all.