summaryrefslogtreecommitdiff
path: root/lib/overload.pm
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-06-18 07:41:37 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-06-18 07:41:37 +0000
commit3bc6ec8038d110d76f73b0833a2cc894ac5ab2cb (patch)
treea696a9a8f71038001a56de1bd0777bc9741e4b31 /lib/overload.pm
parent6ecfc29d5a0d124e6e6ffb770d1f00e249928746 (diff)
downloadperl-3bc6ec8038d110d76f73b0833a2cc894ac5ab2cb.tar.gz
perl 5.003_01: lib/overload.pm
Drop support for null package name or package "0" Document fallbacks for logical negation
Diffstat (limited to 'lib/overload.pm')
-rw-r--r--lib/overload.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/overload.pm b/lib/overload.pm
index 54d2cbb441..28e7d0b3e7 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -26,18 +26,18 @@ sub unimport {
}
sub Overloaded {
- defined ($package = ref $_[0]) and defined %{$package . "::OVERLOAD"};
+ ($package = ref $_[0]) and defined %{$package . "::OVERLOAD"};
}
sub OverloadedStringify {
- defined ($package = ref $_[0]) and
+ ($package = ref $_[0]) and
defined %{$package . "::OVERLOAD"} and
exists $ {$package . "::OVERLOAD"}{'""'} and
defined &{$ {$package . "::OVERLOAD"}{'""'}};
}
sub Method {
- defined ($package = ref $_[0]) and
+ ($package = ref $_[0]) and
defined %{$package . "::OVERLOAD"} and
$ {$package . "::OVERLOAD"}{$_[1]};
}
@@ -186,7 +186,9 @@ arrays, C<cmp> is used to compare values subject to C<use overload>.
"&", "^", "|", "neg", "!", "~",
"C<neg>" stands for unary minus. If the method for C<neg> is not
-specified, it can be autogenerated using the method for subtraction.
+specified, it can be autogenerated using the method for
+subtraction. If the method for "C<!>" is not specified, it can be
+autogenerated using the methods for "C<bool>", or "C<\"\">", or "C<0+>".
=item * I<Increment and decrement>
@@ -361,6 +363,11 @@ can be expressed in terms of C<$aE<lt>0> and C<-$a> (or C<0-$a>).
can be expressed in terms of subtraction.
+=item I<Negation>
+
+C<!> and C<not> can be expressed in terms of boolean conversion, or
+string or numerical conversion.
+
=item I<Concatenation>
can be expressed in terms of string conversion.