Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: How to get code of the calling function or object

by tmaly (Monk)
on Mar 25, 2011 at 13:18 UTC ( [id://895479]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to get code of the calling function or object
in thread How to get code of the calling function or object

I started doing something like this after I came across a node a while back. I cannot find the link to the node now.

My test code was

use B::Deparse; my $sr = sub { print "Hello\n" }; $sr->(); my $code = B::Deparse->new->coderef2text($sr); $code =~ s/print \s\S+/die "Bye";/; $sr = eval "sub $code"; $sr->();

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://895479]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found