I have a couple of suggestions for you. First, in your first script that triggers the problem, turn off warnings. According to the perldebug docs:

"The debugger does not currently work in conjunction with the -W command-line switch because it itself is not free of warnings"

In other words, the debugger can be buggy, so you have to play with it.

Second, for me at least, I don't think that Safe and Devel::DProf are a good fit for use on mod_perl and Apache. Safe, for example, has safety issues. To quote the author:

"Any string eval which is executed by code executing in a compartment, or by code called from code executing in a compartment, will be eval'd in the namespace of the compartment. This is potentially a serious problem."

Also, Safe might also eat up all of your memory; it might also cause infinite looping; it might also open the door to snooping, viruses, etc.; it might also cause signals to interfere with your processes. That's not to say that Safe shouldn't be used here, but you might want to reconsider it.

Apache::DProf, which implements Devel::DProf in Apache, works fine on perl code in Apache, but what about non-perl code? Apache recommends using gdb. So do I. See:

Apache HTTPD Debugging Guide


In reply to Re: DProf + Safe = corrupted tmon.out by Khen1950fx
in thread DProf + Safe = corrupted tmon.out by smammy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.