summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Collins <dcollinsn@gmail.com>2016-10-11 14:54:16 -0400
committerDavid Mitchell <davem@iabyn.com>2016-12-26 12:03:10 +0000
commit6b776407d46448d59a69054c8cd4cec4d91f50c0 (patch)
treeb063a12f3adf78971c3e1e575e3fdaf6ed3722d8 /lib
parentb1b8fb6a79343831521b5657b353f551f7a35074 (diff)
downloadperl-6b776407d46448d59a69054c8cd4cec4d91f50c0.tar.gz
overload.pm: add a missing 'exists'
607ee4356 changed the hash of permitted ops from having '1' as a value to having undef as a value. This also changed one of the warning points from checking for truthiness to existence. However, a second warning was accidentally left checking for truthiness. This commit fixes that oversight, and adds a regression test for warnings in this case.
Diffstat (limited to 'lib')
-rw-r--r--lib/overload.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/overload.pm b/lib/overload.pm
index 758b67d666..ba563143f1 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -1,6 +1,6 @@
package overload;
-our $VERSION = '1.27';
+our $VERSION = '1.28';
%ops = (
with_assign => "+ - * / % ** << >> x .",
@@ -63,7 +63,7 @@ sub unimport {
*{$package . "::(("} = \&nil;
for (@_) {
warnings::warnif("overload arg '$_' is invalid")
- unless $ops_seen{$_};
+ unless exists $ops_seen{$_};
delete $ {$package . "::"}{$_ eq 'fallback' ? '()' : "(" .$_};
}
}