Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
"be consistent"
 
PerlMonks  

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

by ikegami (Pope)
on Oct 12, 2007 at 17:00 UTC ( #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.


Comment on Re^3: Any way to access the contents of a block eval?
Download Code
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
Node Status?
node history
Node Type: note [id://644512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-04-20 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls