diff --git a/Build.PL b/Build.PL index 45962ca..ed49980 100644 --- a/Build.PL +++ b/Build.PL @@ -24,7 +24,7 @@ my %module_build_args = ( 'Kent Fredric ' ], 'dist_name' => 'Data-Handle', - 'dist_version' => '0.01011500', + 'dist_version' => '0.01011501', 'license' => 'perl', 'module_name' => 'Data::Handle', 'recommends' => {}, diff --git a/Changes b/Changes index 79a3216..cd4af52 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,16 @@ Revision history for Data-Handle +0.01011501 2010-12-20 02:15:59 Pacific/Auckland + + The method we were borrowing out of Carp wasn't there in old versions, + so we've added a bit of magic to try get it from older carps too, so we don't fail + on <= 5.10.1 :( + + Changes | 11 +++++++++++ + lib/Data/Handle/Exception.pm | 17 +++++++++++++---- + 2 files changed, 24 insertions(+), 4 deletions(-) + + 0.01011500 2010-12-20 01:36:06 Pacific/Auckland More tests to improve general function coverage diff --git a/META.json b/META.json index dd00dd9..47659a9 100644 --- a/META.json +++ b/META.json @@ -62,15 +62,15 @@ "provides" : { "Data::Handle" : { "file" : "lib/Data/Handle.pm", - "version" : "0.01011500" + "version" : "0.01011501" }, "Data::Handle::Exception" : { "file" : "lib/Data/Handle/Exception.pm", - "version" : "0.01011500" + "version" : "0.01011501" }, "Data::Handle::IO" : { "file" : "lib/Data/Handle/IO.pm", - "version" : "0.01011500" + "version" : "0.01011501" } }, "release_status" : "stable", @@ -82,7 +82,7 @@ "web" : "http://github.com/kentfredric/Data-Handle/tree" } }, - "version" : "0.01011500", + "version" : "0.01011501", "x_BuiltWith" : { "modules" : { "Carp" : "1.17", diff --git a/META.yml b/META.yml index 0c3826d..7a9a98d 100644 --- a/META.yml +++ b/META.yml @@ -23,13 +23,13 @@ name: Data-Handle provides: Data::Handle: file: lib/Data/Handle.pm - version: 0.01011500 + version: 0.01011501 Data::Handle::Exception: file: lib/Data/Handle/Exception.pm - version: 0.01011500 + version: 0.01011501 Data::Handle::IO: file: lib/Data/Handle/IO.pm - version: 0.01011500 + version: 0.01011501 requires: Carp: 0 IO::File: 0 @@ -42,7 +42,7 @@ requires: resources: homepage: http://github.com/kentfredric/Data-Handle/tree repository: git://github.com/kentfredric/Data-Handle.git -version: 0.01011500 +version: 0.01011501 x_BuiltWith: modules: Carp: 1.17 diff --git a/README b/README index e0b9460..f052684 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Data::Handle - A Very simple interface to the __DATA__ file handle. VERSION - version 0.01011500 + version 0.01011501 SYNOPSIS package Foo; diff --git a/lib/Data/Handle.pm b/lib/Data/Handle.pm index cd89eee..a169c33 100644 --- a/lib/Data/Handle.pm +++ b/lib/Data/Handle.pm @@ -3,7 +3,7 @@ use warnings; package Data::Handle; BEGIN { - $Data::Handle::VERSION = '0.01011500'; + $Data::Handle::VERSION = '0.01011501'; } # ABSTRACT: A Very simple interface to the __DATA__ file handle. @@ -246,7 +246,7 @@ Data::Handle - A Very simple interface to the __DATA__ file handle. =head1 VERSION -version 0.01011500 +version 0.01011501 =head1 SYNOPSIS diff --git a/lib/Data/Handle/Exception.pm b/lib/Data/Handle/Exception.pm index d55cae2..adf8494 100644 --- a/lib/Data/Handle/Exception.pm +++ b/lib/Data/Handle/Exception.pm @@ -3,7 +3,7 @@ use warnings; package Data::Handle::Exception; BEGIN { - $Data::Handle::Exception::VERSION = '0.01011500'; + $Data::Handle::Exception::VERSION = '0.01011501'; } # ABSTRACT: Super-light Weight Dependency Free Exception base. @@ -34,6 +34,17 @@ sub throw { my @stack = (); my @stacklines = (); + my $callerinfo; + + if ( not defined &Carp::caller_info ) { + ## no critic (RequireBarewordIncludes, ProhibitPunctuationVars ) + require 'Carp/Heavy.pm' unless $^O eq 'MSWin32'; + require 'Carp\Heavy.pm' if $^O eq 'MSWin32'; + $callerinfo = \&Carp::Heavy::caller_info; + } + else { + $callerinfo = \&Carp::caller_info; + } { # stolen parts from Carp::ret_backtrace my ($i) = 0; @@ -43,12 +54,12 @@ sub throw { $tid_msg = " thread $tid" if $tid; } - my %i = Carp::caller_info($i); + my %i = $callerinfo->($i); push @stack, \%i; push @stacklines, sprintf q{Exception '%s' thrown at %s line %s%s}, blessed($self), $i{file}, $i{line}, $tid_msg; - while ( my %j = Carp::caller_info( ++$i ) ) { + while ( my %j = $callerinfo->( ++$i ) ) { push @stack, \%j; push @stacklines, sprintf q{%s called at %s line %s%s}, $j{sub_name}, $j{file}, $j{line}, $tid_msg; } @@ -116,9 +127,7 @@ sub _gen { sub _gen_tree { my ( $self, $class ) = @_; my $parent = $class; - require Carp; - # Carp::carp("Generating $class."); $parent =~ s{ ::[^:]+$ }{}x; @@ -147,7 +156,7 @@ Data::Handle::Exception - Super-light Weight Dependency Free Exception base. =head1 VERSION -version 0.01011500 +version 0.01011501 =head1 SYNOPSIS diff --git a/lib/Data/Handle/IO.pm b/lib/Data/Handle/IO.pm index 0be068b..feed414 100644 --- a/lib/Data/Handle/IO.pm +++ b/lib/Data/Handle/IO.pm @@ -4,7 +4,7 @@ use warnings; package Data::Handle::IO; BEGIN { - $Data::Handle::IO::VERSION = '0.01011500'; + $Data::Handle::IO::VERSION = '0.01011501'; } # ABSTRACT: A Tie Package so Data::Handle can look and feel like a normal handle. @@ -49,7 +49,7 @@ Data::Handle::IO - A Tie Package so Data::Handle can look and feel like a normal =head1 VERSION -version 0.01011500 +version 0.01011501 =head1 DESCRIPTION