diff options
Diffstat (limited to 'pod/perlovl.pod')
-rw-r--r-- | pod/perlovl.pod | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/pod/perlovl.pod b/pod/perlovl.pod index db00f4dbf1..cdb3ba66c5 100644 --- a/pod/perlovl.pod +++ b/pod/perlovl.pod @@ -114,7 +114,7 @@ arrays, C<cmp> is used to compare values subject to %OVERLOAD. =item * I<Bit operations> - "&", "^", "|", "neg", "!", "~", + "&", "^", "|", "&=", "^=", "|=", "neg", "!", "~", "C<neg>" stands for unary minus. If the method for C<neg> is not specified, it can be autogenerated using on the method for subtraction. @@ -206,10 +206,7 @@ C<$OVERLOAD{"nomethod"}>, and if this is missing, raises an exception. =head2 Copy Constructor C<$OVERLOAD{"="}> is a reference to a function with three arguments, -i.e., it looks like a usual value of %OVERLOAD. What is special about -this subroutine is that it should not return a blessed reference into -a package (as most other methods are expected to), but rather a freshly made -copy of its dereferenced argument (see L<"BUGS">, though). This operation +i.e., it looks like a usual value of %OVERLOAD. This operation is called in the situations when a mutator is applied to a reference that shares its object with some other reference, such as @@ -287,7 +284,8 @@ value is scalar but not a reference. =head1 WARNING The restriction for the comparison operation is that even if, for example, -`C<cmp>' should return a blessed reference, the autogenerated `C<lt>' +`C<cmp>' should return a reference to a blessed object, the +autogenerated `C<lt>' function will produce only a standard logical value based on the numerical value of the result of `C<cmp>'. In particular, a working numeric conversion is needed in this case (possibly expressed in terms of @@ -351,12 +349,6 @@ induces diagnostic messages. Because it's used for overloading, the per-package associative array %OVERLOAD now has a special meaning in Perl. -Although the copy constructor is specially designed to make overloading -operations with references to an array simpler, as it now works it's -useless for this because a subroutine cannot return an array in the same -way as it returns a scalar (from the point of view of Perl -internals). Expect a change of interface for the copy constructor. - As shipped, %OVERLOAD is not inherited via the @ISA tree. A patch for this is available from the author. |