Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to instrument a "fake" subroutine?

by ton (Friar)
on May 22, 2002 at 19:08 UTC ( [id://168550]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://168550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-16 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found