From 12a2b23e203089a3ea171442e9a20bb6afcd3a3c Mon Sep 17 00:00:00 2001 From: Steven Haryanto Date: Thu, 1 Jul 2010 16:08:11 +0700 Subject: [PATCH] fix handling of undef, prepare v0.02 --- Changes | 5 +++++ dist.ini | 2 +- lib/Data/Dump/Partial.pm | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index dc7587c..3f1ddea 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Data-Dump-Partial +0.02 2010-07-01 + + Correct handling of undef. + + 0.01 2010-06-26 First release. diff --git a/dist.ini b/dist.ini index 1555a31..2be6825 100644 --- a/dist.ini +++ b/dist.ini @@ -1,5 +1,5 @@ name = Data-Dump-Partial -version = 0.01 +version = 0.02 author = Steven Haryanto license = Perl_5 copyright_holder = Steven Haryanto diff --git a/lib/Data/Dump/Partial.pm b/lib/Data/Dump/Partial.pm index 4e005a7..1a84919 100644 --- a/lib/Data/Dump/Partial.pm +++ b/lib/Data/Dump/Partial.pm @@ -104,7 +104,7 @@ sub dump_partial { my $filter = sub { my ($ctx, $oref) = @_; - if ($opts->{max_len} && $ctx->is_scalar && + if ($opts->{max_len} && $ctx->is_scalar && defined($$oref) && length($$oref) > $opts->{max_len}) { return { object => substr($$oref, 0, $opts->{max_len}-3)."..." };