USEFULE UPDATE:) Ignore all the stuff below and add the following line just above the use Time::HiRes 'time'; at line 9 of SmallProf.pm.

sub DB{ return; }

This satsfies the error created when the debugger tries to invoke DB::DB() as Time::HiRes is loaded at BEGIN time, which is before the DB::DB() sub has been compiled. If you enable warnings via the command line with -w, you will see the error msg

Subroutine DB redefined at D:/Perl/lib/Devel/SmallProf.pm line 50.

When the above benign routine is replaced by the real one. Other than that, this fix seems to be completely effective and transparent.

END UPDATE - Everything below is redundant

I'm not sure that this a complete answer, but I found that if you comment out the use Time::HiRes 'time'; at line 4 9 of SmallProf.pm, the profiling completes without error.

The problem then is, that the wallclock times are then calculated using the built-in time function (with it's inherent limitation of whole second resolution) rather than the Time::HiRes equivalent with its sub-second resolution.

This renders the wallclock timimgs pretty useless unless you have really long running processes, but the iteration counts and cpu second times remain unaffected. As these are, for the most part, the most useful figures, it may at least allow you to continue until the p5p guys resolve the problem properly.

I tried moving the use line around various places, but it seems to be some weird sort of circular dependancy that is tripping it up. Anyway, maybe this will help you some.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

In reply to Re: A substitute for Devel::Smallprof? by BrowserUk
in thread A substitute for Devel::Smallprof? by ric

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.