Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Can caller() or the call stack be tricked?

by Eily (Parson)
on Jul 08, 2013 at 13:03 UTC ( #1043119=note: print w/replies, xml ) Need Help??


in reply to Can caller() or the call stack be tricked?

It looks like a job for goto

After the goto, not even caller() will be able to tell that this routine was called first.

So if you goto &{'debug'}; after you shitfed $self out, you'll "call" your debug subroutine seemlessly, as if you were there in the first place. Be careful about unshifting or shifting the $self argument into @_ when you do that.

Replies are listed 'Best First'.
Re^2: Can caller() or the call stack be tricked?
by Ralesk (Pilgrim) on Jul 08, 2013 at 13:09 UTC

    Hah!, I knew I’d seen something like this before — thanks!

    Also, that manual is the most hilarious thing ever. “Create spaghetti code”.

    One of the reasons I love Perl is that it has quips like this throughout its documentation.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043119]
help
Chatterbox?
[stevieb]: ffs... an hour I've been trying to get a Pi to communicate I2C to an Arduino. Had to slow down the communication channel. Sigh

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2017-06-22 22:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (531 votes). Check out past polls.