diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2012-05-31 11:46:40 +0100 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2012-06-15 14:33:48 +0100 |
commit | 83f18a67f66d28945f04d4d568c0f9561dc30932 (patch) | |
tree | 458540f23b6df38002ae5280eab532041605efda /cpan/Object-Accessor/lib | |
parent | 96e633ea56c1df47b3409393a1942f435cf9f6ad (diff) | |
download | perl-83f18a67f66d28945f04d4d568c0f9561dc30932.tar.gz |
Updated Object-Accessor to CPAN version 0.44
[DELTA]
Changes for 0.44 Wed Apr 25 14:08:30 BST 2012
=================================================
* can() is now fasteh thanks to Vincent Pit
Diffstat (limited to 'cpan/Object-Accessor/lib')
-rw-r--r-- | cpan/Object-Accessor/lib/Object/Accessor.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cpan/Object-Accessor/lib/Object/Accessor.pm b/cpan/Object-Accessor/lib/Object/Accessor.pm index edee181d07..106e70e762 100644 --- a/cpan/Object-Accessor/lib/Object/Accessor.pm +++ b/cpan/Object-Accessor/lib/Object/Accessor.pm @@ -4,13 +4,12 @@ use strict; use Carp qw[carp croak]; use vars qw[$FATAL $DEBUG $AUTOLOAD $VERSION]; use Params::Check qw[allow]; -use Data::Dumper; ### some objects might have overload enabled, we'll need to ### disable string overloading for callbacks require overload; -$VERSION = '0.42'; +$VERSION = '0.44'; $FATAL = 0; $DEBUG = 0; @@ -430,19 +429,20 @@ sub can { my($self, $method) = @_; ### it's one of our regular methods - if( $self->UNIVERSAL::can($method) ) { - __PACKAGE__->___debug( "Can '$method' -- provided by package" ); - return $self->UNIVERSAL::can($method); + my $code = $self->UNIVERSAL::can($method); + if( $code ) { + carp( "Can '$method' -- provided by package" ) if $DEBUG; + return $code; } ### it's an accessor we provide; if( UNIVERSAL::isa( $self, 'HASH' ) and exists $self->{$method} ) { - __PACKAGE__->___debug( "Can '$method' -- provided by object" ); + carp( "Can '$method' -- provided by object" ) if $DEBUG; return sub { $self->$method(@_); } } ### we don't support it - __PACKAGE__->___debug( "Cannot '$method'" ); + carp( "Cannot '$method'" ) if $DEBUG; return; } @@ -611,7 +611,6 @@ sub ___debug { my $self = shift; my $msg = shift; - my $lvl = shift || 0; local $Carp::CarpLevel += 1; @@ -741,7 +740,6 @@ See C<perldoc perlsub> for details. ### standard tie class for bound attributes { package Object::Accessor::TIE; use Tie::Scalar; - use Data::Dumper; use base 'Tie::StdScalar'; my %local = (); |