Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 exploiting the Monastery: (9)
As of 2015-07-07 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls