From: Vincent Pit Date: Wed, 20 Aug 2008 19:01:20 +0000 (+0200) Subject: Make the sample script use B::RecDeparse when available X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=9e42e470d0042056765361fbcbf828492ee58d9c;p=perl%2Fmodules%2FSub-Nary.git Make the sample script use B::RecDeparse when available --- diff --git a/samples/cx.pl b/samples/cx.pl index fec9577..14cb237 100755 --- a/samples/cx.pl +++ b/samples/cx.pl @@ -4,7 +4,16 @@ use strict; use warnings; use lib qw{blib/lib blib/arch}; -use B::Deparse; + +my $bd; +BEGIN { + if (eval "use B::RecDeparse; 1") { + $bd = B::RecDeparse->new; + } else { + use B::Deparse; + $bd = B::Deparse->new; + } +} use B::Concise; use Sub::Nary; @@ -63,7 +72,6 @@ sub ifr { my $code = \&wut; -my $bd = B::Deparse->new(); print STDERR $bd->coderef2text($code), "\n"; B::Concise::walk_output(\*STDERR);