in reply to How to instrument a "fake" subroutine?

To check if the subroutine really exists:

if (defined(&Fcntl::LOCK_EX))

To get desired behavior: just call the subroutine once before attempting to redefine it.

-Ton
-----
Be bloody, bold, and resolute; laugh to scorn
The power of man...

Replies are listed 'Best First'.
Re: Re: How to instrument a "fake" subroutine?
by samtregar (Abbot) on May 22, 2002 at 19:32 UTC
    Thanks for the check code! Unfortunately, I can't just call the sub before instrumenting it. What if it has side-effects or produces output? Devel::Profiler can't make the assumption that calling subroutines before they're used is harmless.

    -sam