summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/lib/overload.pm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/lib/overload.pm')
-rw-r--r--gnu/usr.bin/perl/lib/overload.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/lib/overload.pm b/gnu/usr.bin/perl/lib/overload.pm
index 4a1912c2366..f7d5d0f7cf9 100644
--- a/gnu/usr.bin/perl/lib/overload.pm
+++ b/gnu/usr.bin/perl/lib/overload.pm
@@ -1,6 +1,6 @@
package overload;
-our $VERSION = '1.26';
+our $VERSION = '1.30';
%ops = (
with_assign => "+ - * / % ** << >> x .",
@@ -21,9 +21,7 @@ our $VERSION = '1.26';
);
my %ops_seen;
-for $category (keys %ops) {
- $ops_seen{$_}++ for (split /\s+/, $ops{$category});
-}
+@ops_seen{ map split(/ /), values %ops } = ();
sub nil {}
@@ -40,7 +38,7 @@ sub OVERLOAD {
}
} else {
warnings::warnif("overload arg '$_' is invalid")
- unless $ops_seen{$_};
+ unless exists $ops_seen{$_};
$sub = $arg{$_};
if (not ref $sub) {
$ {$package . "::(" . $_} = $sub;
@@ -65,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' ? '()' : "(" .$_};
}
}
@@ -312,7 +310,7 @@ An appropriate implementation of C<--> might look like
# ...
sub decr { --${$_[0]}; }
-If the experimental "bitwise" feature is enabled (see L<feature>), a fifth
+If the "bitwise" feature is enabled (see L<feature>), a fifth
TRUE argument is passed to subroutines handling C<&>, C<|>, C<^> and C<~>.
This indicates that the caller is expecting numeric behaviour. The fourth
argument will be C<undef>, as that position (C<$_[3]>) is reserved for use
@@ -695,7 +693,7 @@ The specified function will be passed four parameters.
The first three arguments coincide with those that would have been
passed to the corresponding method if it had been defined.
The fourth argument is the C<use overload> key for that missing
-method. If the experimental "bitwise" feature is enabled (see L<feature>),
+method. If the "bitwise" feature is enabled (see L<feature>),
a fifth TRUE argument is passed to subroutines handling C<&>, C<|>, C<^> and C<~> to indicate that the caller is expecting numeric behaviour.
For example, if C<$a> is an object blessed into a package declaring