in reply to Re: Re: How to instrument a "fake" subroutine?
in thread How to instrument a "fake" subroutine?
I don't think I follow. How does it work on non-fake subs then?Hmm, I think we may have our wires crossed (that'll teach me for posting after 10pm ;-) My reasoning is that if your return is the call from a coderef that is pointing to the current coderef then of course it will recurse e.g
$f is just pointing to *main::foo{CODE} and since &foo is defined by the time it is called $f will then be pointing to a fully fledged sub and it recurses. Am I missing something?my $f = \&foo; *foo = sub { print "in foo()\n"; return &$f; } foo(); __output__ in foo() in foo() ... and so on
_________
broquaint
update: changed sub foo to *foo = sub {}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: How to instrument a "fake" subroutine?
by samtregar (Abbot) on May 22, 2002 at 21:24 UTC |