X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FAccessor%2FNative%2FArray%2Fpop.pm;h=0bccc88e018ad0810b983d212c2a7bf15f5f5b15;hb=bb8ef15197850184a45acade3e8f387fd6b63829;hp=500a448dc1c5276d1e267f37799696de2e2c5825;hpb=245478d5ee6b5343e4d591be811582963e177bef;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm index 500a448..0bccc88 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm @@ -3,7 +3,7 @@ package Moose::Meta::Method::Accessor::Native::Array::pop; use strict; use warnings; -our $VERSION = '1.19'; +our $VERSION = '1.9900'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -23,27 +23,33 @@ sub _maximum_arguments { 0 } sub _adds_members { 0 } sub _potential_value { - my ( $self, $slot_access ) = @_; + my $self = shift; + my ($slot_access) = @_; - return "[ \@{ ($slot_access) } > 1 ? \@{ ($slot_access) }[ 0 .. \$#{ ($slot_access) } - 1 ] : () ]"; + return '[ @{ (' . $slot_access . ') } > 1 ' + . '? @{ (' . $slot_access . ') }[0..$#{ (' . $slot_access . ') } - 1] ' + . ': () ]'; } sub _inline_capture_return_value { - my ( $self, $slot_access ) = @_; + my $self = shift; + my ($slot_access) = @_; - return "my \$old = ${slot_access}->[-1];"; + return 'my $old = ' . $slot_access . '->[-1];'; } sub _inline_optimized_set_new_value { - my ( $self, $inv, $new, $slot_access ) = @_; + my $self = shift; + my ($inv, $new, $slot_access) = @_; - return "pop \@{ ($slot_access) }"; + return 'pop @{ (' . $slot_access . ') };'; } sub _return_value { - my ( $self, $slot_access ) = @_; + my $self = shift; + my ($slot_access) = @_; - return 'return $old;'; + return '$old'; } no Moose::Role;