Lines Matching defs:overload

1 package overload;
5 $overload::hint_bits = 0x20000; # HINT_LOCALIZE_HH
35 $package->overload::OVERLOAD(@_);
140 warnings::warnif ("Odd number of arguments for overload::constant");
156 $^H |= $constants{$_[0]} | $overload::hint_bits;
177 overload - Package for overloading perl operations
183 use overload
193 if (overload::Overloaded $b) {...}
195 $strval = overload::StrVal $b;
204 use overload
232 The functions specified in the C<use overload ...> directive are called
312 use overload '+' => sub { bless [ \$_[0], \$_[1] ] };
317 can overload C<+=> explicitly by a non-"optimized" version, or switch
329 The following symbols can be specified in C<use overload> directive:
355 arrays, C<cmp> is used to compare values subject to C<use overload>.
396 As a special case if the overload returns the object itself then it will
421 As a special case if the overload returns the object itself then it
431 see L<SPECIAL SYMBOLS FOR C<use overload>>.
439 %overload::ops, with values being space-separated lists of names:
461 =item Strings as values of C<use overload> directive
465 use overload key => value;
489 =head1 SPECIAL SYMBOLS FOR C<use overload>
507 C<use overload> directive.
515 unless C<"fallback"> was specified as a key in C<use overload> directive.
536 it silently reverts to what it would have done were there no C<use overload>
553 overload>. However, it does not overload the Perl assignment
691 eval 'use overload "+" => \&addmethod';
695 eval 'no overload "+", "--", "<="';
701 Package C<overload.pm> provides the following public functions:
705 =item overload::StrVal(arg)
709 =item overload::Overloaded(arg)
713 =item overload::Method(obj,op)
722 to hook into this process via overload::constant() and overload::remove_constant()
732 to overload integer constants,
736 to overload floating point constants,
740 to overload octal and hexadecimal constants,
744 to overload C<q>-quoted strings, constant pieces of C<qq>- and C<qx>-quoted
749 to overload constant pieces of regular expressions.
771 Note that it is probably meaningless to call the functions overload::constant()
772 and overload::remove_constant() from anywhere but import() and unimport() methods.
779 overload::constant integer => sub {Math::BigInt->new(shift)};
791 processing of C<use overload>, C<no overload>, new function
805 If an object belongs to a package using overload, it carries a special
809 In fact, if C<use overload> is not present, there is almost no overhead
812 minimize the overhead when overload is used in some package, but the
813 arguments in question do not belong to packages using overload. When
814 in doubt, test your speed with C<use overload> and without it. So far
818 There is no size penalty for data if overload is not used. The only
819 size penalty if overload is used in some package is that I<all> the
889 to an object do whatever you want. It is just not the overload, but
908 use overload '""' => \&str, '0+' => \&num, fallback => 1;
934 use overload '%{}' => \&gethash, '@{}' => sub { $ {shift()} };
970 I<actual> type of $bar is a scalar reference, and we do not overload
973 overload dereference). Similarly, the object returned by the
980 Both these problems can be cured. Say, if we want to overload hash
989 bless $self, 'overload::dummy'; # Disable overloading of %{}
999 use overload '%{}' => sub { ${shift()}->[1] },
1057 use overload nomethod => \&wrap;
1117 is natural to overload the operator C<""> using this method. However,
1125 use overload nomethod => \&wrap, '""' => \&str;
1159 use overload
1229 foreach my $op (split " ", $overload::ops{with_assign}) {
1233 foreach my $op (split " ", "@overload::ops{ @bins }") {
1236 foreach my $op (split " ", "@overload::ops{qw(unary func)}") {
1247 To implement a copy constructor, add C<< '=' => \&cpy >> to C<use overload>
1275 foreach my $op (split " ", $overload::ops{with_assign}) {
1279 foreach my $op (split " ", "@overload::ops{ @bins }") {
1282 foreach my $op (split " ", "@overload::ops{qw(unary func)}") {
1384 function of module C<overload>).
1390 =item Odd number of arguments for overload::constant
1392 (W) The call to overload::constant contained an odd number of arguments.
1397 (W) You tried to overload a constant type the overload package is unaware of.
1401 (W) The second (fourth, sixth, ...) argument of overload::constant needs