.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Devel::OverloadInfo 3pm" .TH Devel::OverloadInfo 3pm "2018-03-18" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Devel::OverloadInfo \- introspect overloaded operators .SH "VERSION" .IX Header "VERSION" version 0.005 .SH "DESCRIPTION" .IX Header "DESCRIPTION" Devel::OverloadInfo returns information about overloaded operators for a given class (or object), including where in the inheritance hierarchy the overloads are declared and where the code implementing them is. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "is_overloaded" .IX Subsection "is_overloaded" .Vb 1 \& if (is_overloaded($class_or_object)) { ... } .Ve .PP Returns a boolean indicating whether the given class or object has any overloading declared. Note that a bare \f(CW\*(C`use overload;\*(C'\fR with no actual operators counts as being overloaded. .PP Equivalent to \&\fIoverload::Overloaded()\fR, but doesn't trigger various bugs associated with it in versions of perl before 5.16. .SS "overload_op_info" .IX Subsection "overload_op_info" .Vb 1 \& my $info = overload_op_info($class_or_object, $op); .Ve .PP Returns a hash reference with information about the specified overloaded operator of the named class or blessed object. .PP Returns \f(CW\*(C`undef\*(C'\fR if the operator is not overloaded. .PP See \*(L"Overloadable Operations\*(R" in overload for the available operators. .PP The keys in the returned hash are as follows: .IP "class" 4 .IX Item "class" The name of the class in which the operator overloading was declared. .IP "code" 4 .IX Item "code" A reference to the function implementing the overloaded operator. .IP "code_name" 4 .IX Item "code_name" The name of the function implementing the overloaded operator, as returned by \f(CW\*(C`sub_fullname\*(C'\fR in Sub::Identify. .IP "method_name (optional)" 4 .IX Item "method_name (optional)" The name of the method implementing the overloaded operator, if the overloading was specified as a named method, e.g. \f(CW\*(C`use overload $op => \*(Aqmethod\*(Aq;\*(C'\fR. .IP "code_class (optional)" 4 .IX Item "code_class (optional)" The name of the class in which the method specified by \f(CW\*(C`method_name\*(C'\fR was found. .IP "value (optional)" 4 .IX Item "value (optional)" For the special \f(CW\*(C`fallback\*(C'\fR key, the value it was given in \f(CW\*(C`class\*(C'\fR. .SS "overload_info" .IX Subsection "overload_info" .Vb 1 \& my $info = overload_info($class_or_object); .Ve .PP Returns a hash reference with information about all the overloaded operators of specified class name or blessed object. The keys are the overloaded operators, as specified in \f(CW%overload::ops\fR (see \&\*(L"Overloadable Operations\*(R" in overload), and the values are the hashes returned by \*(L"overload_op_info\*(R". .SH "CAVEATS" .IX Header "CAVEATS" Whether the \f(CW\*(C`fallback\*(C'\fR key exists when it has its default value of \&\f(CW\*(C`undef\*(C'\fR varies between perl versions: Before 5.18 it's there, in later versions it's not. .SH "AUTHOR" .IX Header "AUTHOR" Dagfinn Ilmari Mannsåker .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2014 by Dagfinn Ilmari Mannsåker. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.