[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [PATCH] Data::Dumper.pm
At 16.02 +0000 2000.01.10, James Duncan wrote:
>--- /usr/local/lib/perl5/5.00558/Data/Dumper.pm Mon Jan 10 12:28:34
>2000
>+++ ./Dumper.pm Mon Jan 10 15:48:01 2000
>@@ -19,6 +19,7 @@
> require overload;
>
> use Carp;
>+use B::Deparse;
Well, some people won't have B available ...
my $haveBDeparse = eval { require B::Deparse };
> @ISA = qw(Exporter DynaLoader);
> @EXPORT = qw(Dumper);
>@@ -334,8 +335,10 @@
> $out .= ($name =~ /^\%/) ? ')' : '}';
> }
> elsif ($realtype eq 'CODE') {
>- $out .= 'sub { "DUMMY" }';
>- carp "Encountered CODE ref, using dummy placeholder" if
>$s->{purity};
if ($haveBDeparse) {
>+ # patched to use B::Deparse's new routines.
>+ my $deparse = B::Deparse->new();
>+ my $body = $deparse->coderef2text($val);
>+ $out .= 'sub ' . $body;
}
> }
> else {
> croak "Can\'t handle $realtype type.";
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
- Follow-Ups from:
-
merlyn@stonehenge.com (Randal L. Schwartz)
- References to:
-
James Duncan <james@ebookers.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]