{"id":7168,"date":"2022-12-20T19:35:42","date_gmt":"2022-12-20T22:35:42","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/datadumptrace-man3\/"},"modified":"2022-12-20T19:35:42","modified_gmt":"2022-12-20T22:35:42","slug":"datadumptrace-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/datadumptrace-man3\/","title":{"rendered":"Data::Dump::Trace (man3)"},"content":{"rendered":"<h1 align=\"center\">Data::Dump::Trace<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Data::Dump::Trace \u2212 Helpers to trace function and method calls<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use Data::Dump::Trace qw(autowrap mcall); <br \/> autowrap(&#8220;LWP::UserAgent&#8221; => &#8220;ua&#8221;, &#8220;HTTP::Response&#8221; => &#8220;res&#8221;); <br \/> use LWP::UserAgent; <br \/> $ua = mcall(LWP::UserAgent => &#8220;new&#8221;); # instead of LWP::UserAgent\u2212>new; <br \/> $ua\u2212>get(&#8220;http:\/\/www.example.com&#8221;)\u2212>dump;<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following functions are provided: <br \/> autowrap( $class ) <br \/> autowrap( $class => $prefix ) <br \/> autowrap( $class1 => $prefix1, $class2 => $prefix2, &#8230; ) <br \/> autowrap( $class1 => %info1, $class2 => %info2, &#8230; )<\/p>\n<p style=\"margin-left:17%;\">Register classes whose objects are automatically wrapped when returned by one of the call functions below. If $prefix is provided it will be used as to name the objects.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Alternative is to pass an %info hash for each class. The recognized keys are: <br \/> prefix => $string<\/p>\n<p style=\"margin-left:23%;\">The prefix string used to name objects of this type.<\/p>\n<p style=\"margin-left:17%;\">proto => %hash<\/p>\n<p style=\"margin-left:23%;\">A hash of prototypes to use for the methods when an object is wrapped.<\/p>\n<p style=\"margin-left:11%;\">wrap( name => $str, func => &#038;func, proto => $proto ) <br \/> wrap( name => $str, obj => $obj, proto => %hash )<\/p>\n<p style=\"margin-left:17%;\">Returns a wrapped function or object. When a wrapped function is invoked then a trace is printed after the underlying function has returned. When a method on a wrapped object is invoked then a trace is printed after the methods on the underlying objects has returned.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">See &#8220;Prototypes&#8221; for description of the &#8220;proto&#8221; argument.<\/p>\n<p style=\"margin-left:11%;\">call( $name, &#038;func, $proto, @ARGS )<\/p>\n<p style=\"margin-left:17%;\">Calls the given function with the given arguments. The trace will use $name as the name of the function.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">See &#8220;Prototypes&#8221; for description of the $proto argument.<\/p>\n<p style=\"margin-left:11%;\">mcall( $class, $method, $proto, @ARGS ) <br \/> mcall( $object, $method, $proto, @ARGS )<\/p>\n<p style=\"margin-left:17%;\">Calls the given method with the given arguments.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">See &#8220;Prototypes&#8221; for description of the $proto argument.<\/p>\n<p style=\"margin-left:11%;\">trace( $symbol, $prototype )<\/p>\n<p style=\"margin-left:17%;\">Replaces the function given by $symbol with a wrapped function.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Prototypes <br \/> Note: The prototype string syntax described here is experimental and likely to change in revisions of this interface<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The $proto argument to <b>call()<\/b> and <b>mcall()<\/b> can optionally provide a prototype for the function call. This give the tracer hints about how to best format the argument lists and if there are <i>in\/out<\/i> or <i>out<\/i> arguments. The general form for the prototype string is:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><arguments> = <return_value><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The default prototype is &#8220;@ = @&#8221;; list of values as input and list of values as output.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The value \u2019%\u2019 can be used for both arguments and return value to say that key\/value pair style lists are used.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Alternatively, individual positional arguments can be listed each represented by a letter:<\/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=\"4%\">\n<p>&#8220;i&#8221;<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"46%\">\n<p>input argument<\/p>\n<\/td>\n<td width=\"37%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p>&#8220;o&#8221;<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"46%\">\n<p>output argument<\/p>\n<\/td>\n<td width=\"37%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p>&#8220;O&#8221;<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"46%\">\n<p>both input and output argument<\/p>\n<\/td>\n<td width=\"37%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">If the return value prototype has &#8220;!&#8221; appended, then it signals that this function sets errno ($!) when it returns a false value. The trace will display the current value of errno in that case.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the return value prototype looks like a variable name (with &#8220;$&#8221; prefix), and the function returns a blessed object, then the variable name will be used as prefix and the returned object automatically traced.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Data::Dump<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright 2009 Gisle Aas.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This library is free software; you can redistribute it and\/or modify it under the same terms as Perl itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Data::Dump::Trace \u2212 Helpers to trace function and method calls <\/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":[3502,3007],"class_list":["post-7168","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-datadumptrace","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7168","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=7168"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7168\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}