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

LOCK_EX is a constant function, so every use of it gets inlined at compile time. Which makes life somewhat tricky because your instrumented LOCK_EX will never get called except in an eval EXPR type call.

Replies are listed 'Best First'.
Re: Re: How to instrument a "fake" subroutine?
by samtregar (Abbot) on May 23, 2002 at 15:36 UTC
    Wrong. Please look at the source for Fcntl.pm to confirm. Devel::Profiler already has code to handle constants, but this is a beast of a different stripe entirely.

    -sam

      Note to self: Always read the fscking source first. I stand corrected, sorry 'bout that.
        No problem. That was actually my assumption too. When I first caught this bug I thought there was something wrong with my constant-detection code. Then I looked in Fcntl.pm and saw what I was really dealing with.

        Which I suppose begs the question, why is Fcntl so damn clever? Is there something wrong with just exporting a constant sub for each symbol?

        -sam