From: Peter Rabbitson Date: Fri, 23 Dec 2011 14:34:11 +0000 (+0100) Subject: Fix missing escape on < 5.8.3 codepath X-Git-Tag: v0.009013~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=673eb4988f20b57235a6e8b9ff7035b95ba98baa;p=gitmo%2FRole-Tiny.git Fix missing escape on < 5.8.3 codepath --- diff --git a/Changes b/Changes index 7ed60d6..47fed69 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ - fix up Class::XSAccessor version check to be more robust - improved documentation + - fix failures on perls < 5.8.3 0.009012 - 2011-11-15 - make Method::Generate::Constructor handle $obj->new diff --git a/lib/Method/Generate/Accessor.pm b/lib/Method/Generate/Accessor.pm index 13e6ccc..204330b 100644 --- a/lib/Method/Generate/Accessor.pm +++ b/lib/Method/Generate/Accessor.pm @@ -387,7 +387,7 @@ sub _generate_simple_set { eval { Scalar::Util::weaken($simple); 1 } or do { if( \$@ =~ /Modification of a read-only value attempted/) { - { local $@; require Carp; } + { local \$@; require Carp; } Carp::croak( sprintf ( 'Reference to readonly value in "%s" can not be weakened on Perl < 5.8.3', $name_str, diff --git a/lib/Moo.pm b/lib/Moo.pm index a756fb9..3f53398 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -43,7 +43,7 @@ sub import { { no strict 'refs'; @{"${target}::ISA"} = do { - {; local $@; require Moo::Object; } ('Moo::Object'); + { local $@; require Moo::Object; } ('Moo::Object'); } unless @{"${target}::ISA"}; } }