Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Any way to access the contents of a block eval?

by ikegami (Patriarch)
on Oct 12, 2007 at 17:00 UTC ( [id://644512]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Any way to access the contents of a block eval?
in thread Any way to access the contents of a block eval?

In that case, chromatic's code simplifies to

use B::Deparse qw( ); my $deparse = B::Deparse->new(); sub lives_ok(&;$) { my ($code, $desc) = @_; $desc = $deparse->coderef2text($code) if !defined($desc); return Text::Exception::lives_ok($code, $desc); }

Be careful to avoid accidently overriding your own functions with those from the module you are extending.

Replies are listed 'Best First'.
Re^4: Any way to access the contents of a block eval?
by adrianh (Chancellor) on Oct 16, 2007 at 13:16 UTC
    D'oh! I knew about that.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found