From: Rafael Garcia-Suarez Date: Wed, 7 Jan 2009 17:49:19 +0000 (+0100) Subject: Use a slightly more paranoid regex X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e70e886df9cd28799f9658be2ada995ec48270f;p=p5sagit%2Fp5-mst-13.2.git Use a slightly more paranoid regex --- diff --git a/lib/overload.pm b/lib/overload.pm index 4d1d375..ba0202d 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -150,7 +150,7 @@ sub constant { elsif (!exists $constants {$_ [0]}) { warnings::warnif ("`$_[0]' is not an overloadable type"); } - elsif (!ref $_ [1] || "$_[1]" !~ /CODE\(0x[\da-f]+\)$/) { + elsif (!ref $_ [1] || "$_[1]" !~ /(^|=)CODE\(0x[0-9a-f]+\)$/) { # Can't use C above as code references can be # blessed, and C would return the package the ref is blessed into. if (warnings::enabled) {