summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-01-07 18:49:19 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-01-08 10:25:25 +0100
commit1e70e886df9cd28799f9658be2ada995ec48270f (patch)
tree8cae34fa3e0030bd7cb9db263110997b74b20082 /lib
parent19d266462241bb9c74189b116458c3843230112f (diff)
downloadperl-1e70e886df9cd28799f9658be2ada995ec48270f.tar.gz
Use a slightly more paranoid regex
Diffstat (limited to 'lib')
-rw-r--r--lib/overload.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/overload.pm b/lib/overload.pm
index 4d1d3755f9..ba0202d905 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<ref $_[1] eq "CODE"> above as code references can be
# blessed, and C<ref> would return the package the ref is blessed into.
if (warnings::enabled) {