summaryrefslogtreecommitdiff
path: root/lib/overload.pm
diff options
context:
space:
mode:
authorTodd Rinaldo <toddr@cpan.org>2020-09-11 17:19:17 -0500
committerTodd Rinaldo <toddr@cpan.org>2020-10-13 12:46:40 -0500
commitba6f05dbf3328e0cf055fb6ae3d48e11f7b7c6c1 (patch)
treeb0eac5bf143f645eda0c614d64f7d7af54844548 /lib/overload.pm
parent6c5cb1edade78fb5e14f9948a720cb5fe3c7b6c5 (diff)
downloadperl-ba6f05dbf3328e0cf055fb6ae3d48e11f7b7c6c1.tar.gz
Fix enough code to get make test_prep working with -dDusedefaultstrict
This change fixes enough code that it's possible to run make test_prep when perl is compiled with -Dusedefaultstrict. There are 2 caveats to this: - Does not address XSLoader/DynaLoader already submitted in another PR. - Does not address cpan/Pod-Usage or cpan/Text-Tabs which continue to be outstanding upstream.
Diffstat (limited to 'lib/overload.pm')
-rw-r--r--lib/overload.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/overload.pm b/lib/overload.pm
index c8b46f4487..8a5eeb8df8 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -1,8 +1,11 @@
package overload;
-our $VERSION = '1.32';
+use strict;
+no strict 'refs';
-%ops = (
+our $VERSION = '1.33';
+
+our %ops = (
with_assign => "+ - * / % ** << >> x .",
assign => "+= -= *= /= %= **= <<= >>= x= .=",
num_comparison => "< <= > >= == !=",
@@ -26,7 +29,7 @@ my %ops_seen;
sub nil {}
sub OVERLOAD {
- $package = shift;
+ my $package = shift;
my %arg = @_;
my $sub;
*{$package . "::(("} = \&nil; # Make it findable via fetchmethod.
@@ -51,14 +54,14 @@ sub OVERLOAD {
}
sub import {
- $package = (caller())[0];
+ my $package = (caller())[0];
# *{$package . "::OVERLOAD"} = \&OVERLOAD;
shift;
$package->overload::OVERLOAD(@_);
}
sub unimport {
- $package = (caller())[0];
+ my $package = (caller())[0];
shift;
*{$package . "::(("} = \&nil;
for (@_) {
@@ -131,7 +134,7 @@ sub mycan { # Real can would leave stubs.
return undef;
}
-%constants = (
+my %constants = (
'integer' => 0x1000, # HINT_NEW_INTEGER
'float' => 0x2000, # HINT_NEW_FLOAT
'binary' => 0x4000, # HINT_NEW_BINARY