in reply to stack-frame-substituting subs indirectly?
You could use the magical form of goto.
From perlsyn
The goto-&NAME form is highly magical, and substitutes a call to the n +amed subroutine for the currently running subroutine. This is used by + AUTOLOAD() subroutines that wish to load another subroutine and then + pretend that the other subroutine had been called in the first place + (except that any modifications to @_ in the current subroutine are p +ropagated to the other subroutine.) After the goto, not even caller() + will be able to tell that this routine was called first.
So this should work (I think).
sub callit { goto &$p; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: stack-frame-substituting subs indirectly?
by Louis_Wu (Chaplain) on Nov 05, 2002 at 06:49 UTC | |
by particle (Vicar) on Nov 05, 2002 at 13:56 UTC | |
by Louis_Wu (Chaplain) on Nov 05, 2002 at 20:12 UTC |