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; }

Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy

Replies are listed 'Best First'.
Re: Re: stack-frame-substituting subs indirectly?
by Louis_Wu (Chaplain) on Nov 05, 2002 at 06:49 UTC
    Wow, I didn't know that Perl had a goto funtion. ... Something to abuse. :)

    When I've learned how to use it correctly. :(

      see Would you use 'goto' here? for one of the best discussions related to goto on this site, before you cause too much trouble ;)

      ~Particle *accelerates*

        Thanks for the link. I'm still learning pigdin Perl, so I'll put that link in my "round tuit" file. Maybe on my userpage. :)