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.