From: Dave Rolsky Date: Mon, 14 Sep 2009 15:37:32 +0000 (-0500) Subject: Shut up "calling new on object" warning X-Git-Tag: 0.90~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f68fa9b44fabe868c890b7e489e64c8ebc47b22f;p=gitmo%2FMoose.git Shut up "calling new on object" warning --- diff --git a/t/200_examples/003_example.t b/t/200_examples/003_example.t index 1745839..2e081bb 100644 --- a/t/200_examples/003_example.t +++ b/t/200_examples/003_example.t @@ -30,7 +30,7 @@ sub Y { sub head { (shift)->_list->[0] } sub tail { my $self = shift; - $self->new( + (ref $self)->new( '::' => [ @{$self->_list}[1 .. $#{$self->_list}] ] @@ -67,7 +67,7 @@ sub Y { my $redo = shift; sub { my ($list, $func, $acc) = @_; - return $list->new('::' => $acc) + return (ref $list)->new('::' => $acc) if $list->is_empty; $redo->( $list->tail,