From: Fuji, Goro Date: Sat, 25 Sep 2010 04:22:24 +0000 (+0900) Subject: Make ScalarRef accept ref to ref in pure perl type constraints X-Git-Tag: 0.72~27 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4068a8f62faf3cbc8a569873763076d08a17c3e4;p=gitmo%2FMouse.git Make ScalarRef accept ref to ref in pure perl type constraints --- diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index 5e136c9..23b89a9 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -156,7 +156,7 @@ sub Str { sub Ref { ref($_[0]) } sub ScalarRef { my($value) = @_; - return ref($value) eq 'SCALAR' + return ref($value) eq 'SCALAR' || ref($value) eq 'REF'; } sub ArrayRef { ref($_[0]) eq 'ARRAY' } sub HashRef { ref($_[0]) eq 'HASH' }