{"id":7154,"date":"2022-12-20T19:35:39","date_gmt":"2022-12-20T22:35:39","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/classmopoverload-man3\/"},"modified":"2022-12-20T19:35:39","modified_gmt":"2022-12-20T22:35:39","slug":"classmopoverload-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/classmopoverload-man3\/","title":{"rendered":"Class::MOP::Overload (man3)"},"content":{"rendered":"<h1 align=\"center\">Class::MOP::Overload<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#VERSION\">VERSION<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#INHERITANCE\">INHERITANCE<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a><br \/> <a href=\"#COPYRIGHT AND LICENSE\">COPYRIGHT AND LICENSE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Class::MOP::Overload \u2212 Overload Meta Object<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">version 2.2014<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">my $meta = Class\u2212>meta; <br \/> my $overload = $meta\u2212>get_overloaded_operator(&#8216;+&#8217;); <br \/> if ( $overload\u2212>has_method_name ) { <br \/> print &#8216;Method for + is &#8216;, $overload\u2212>method_name, &#8220;n&#8221;; <br \/> } <br \/> else { <br \/> print &#8216;Overloading for + is implemented by &#8216;, <br \/> $overload\u2212>coderef_name, &#8221; subn&#8221;; <br \/> }<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This class provides meta information for overloading in classes and roles.<\/p>\n<h2>INHERITANCE <a name=\"INHERITANCE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">&#8220;Class::MOP::Overload&#8221; is a subclass of Class::MOP::Object.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Class::MOP::Overload\u2212>new(%options)<\/b> <br \/> This method creates a new &#8220;Class::MOP::Overload&#8221; object. It accepts a number of options:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"12%\">\n<p>operator<\/p>\n<\/td>\n<td width=\"71%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This is a string that matches an operator known by the overload module, such as &#8220;&#8221; or &#8220;+&#8221;. This is required.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"17%\">\n<p style=\"margin-top: 1em\">method_name<\/p>\n<\/td>\n<td width=\"66%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The name of the method which implements the overloading. Note that this does not need to actually correspond to a real method, since it\u2019s okay to declare a not-yet-implemented overloading.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Either this or the &#8220;coderef&#8221; option must be passed.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\">method<\/p>\n<\/td>\n<td width=\"74%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">A Class::MOP::Method object for the method which implements the overloading.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This is optional.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"11%\">\n<p style=\"margin-top: 1em\">coderef<\/p>\n<\/td>\n<td width=\"72%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">A coderef which implements the overloading.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Either this or the &#8220;method_name&#8221; option must be passed.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"23%\">\n<p style=\"margin-top: 1em\">coderef_package<\/p>\n<\/td>\n<td width=\"60%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The package where the coderef was defined.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This is required if &#8220;coderef&#8221; is passed.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"18%\">\n<p style=\"margin-top: 1em\">coderef_name<\/p>\n<\/td>\n<td width=\"65%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The name of the coderef. This can be &#8220;__ANON__&#8221;.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This is required if &#8220;coderef&#8221; is passed.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\">associated_metaclass<\/p>\n<\/td>\n<td width=\"52%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">A Class::MOP::Module object for the associated class or role.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This is optional.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>operator<\/b> <br \/> Returns the operator for this overload object.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>method_name<\/b> <br \/> Returns the method name that implements overloading, if it has one.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>has_method_name<\/b> <br \/> Returns true if the object has a method name.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>method<\/b> <br \/> Returns the Class::MOP::Method that implements overloading, if it has one.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>has_method<\/b> <br \/> Returns true if the object has a method.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>coderef<\/b> <br \/> Returns the coderef that implements overloading, if it has one.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>has_coderef<\/b> <br \/> Returns true if the object has a coderef.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>coderef_package<\/b> <br \/> Returns the package for the coderef that implements overloading, if it has one.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>has_coderef<\/b> <br \/> Returns true if the object has a coderef package.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>coderef_name<\/b> <br \/> Returns the sub name for the coderef that implements overloading, if it has one.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>has_coderef_name<\/b> <br \/> Returns true if the object has a coderef name.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>is_anonymous<\/b> <br \/> Returns true if the overloading is implemented by an anonymous coderef.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>associated_metaclass<\/b> <br \/> Returns the Class::MOP::Module (class or role) that is associated with the overload object.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>clone<\/b> <br \/> Clones the overloading object, setting &#8220;original_overload&#8221; in the process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>$overload\u2212>original_overload<\/b> <br \/> For cloned objects, this returns the Class::MOP::Overload object from which they were cloned. This can be used to determine the source of an overloading in a class that came from a role, for example.<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">Stevan Little <stevan@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Dave Rolsky <autarch@urth.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Jesse Luehrs <doy@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Shawn M Moore <sartak@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>\u00d7\u00d7\u00d7\u00d7 \u00d7\u00a7\u00d7\u00d7\u2019\u00d7\u00d7 (Yuval Kogman) <nothingmuch@woobling.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Karen Etheridge <ether@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Florian Ragwitz <rafl@debian.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Hans Dieter Pearcey <hdp@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Chris Prather <chris@prather.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Matt S Trout <mstrout@cpan.org><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>COPYRIGHT AND LICENSE <a name=\"COPYRIGHT AND LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This software is copyright (c) 2006 by Infinity Interactive, Inc.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This is free software; you can redistribute it and\/or modify it under the same terms as the Perl 5 programming language system itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Class::MOP::Overload \u2212 Overload Meta Object <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3489,3007],"class_list":["post-7154","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-classmopoverload","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7154"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7154\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}