{"id":7442,"date":"2022-12-20T19:38:07","date_gmt":"2022-12-20T22:38:07","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/bhooksendofscope-man3\/"},"modified":"2022-12-20T19:38:07","modified_gmt":"2022-12-20T22:38:07","slug":"bhooksendofscope-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/bhooksendofscope-man3\/","title":{"rendered":"B::Hooks::EndOfScope (man3)"},"content":{"rendered":"<h1 align=\"center\">B::Hooks::EndOfScope<\/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=\"#FUNCTIONS\">FUNCTIONS<\/a><br \/> <a href=\"#LIMITATIONS\">LIMITATIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#SUPPORT\">SUPPORT<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a><br \/> <a href=\"#CONTRIBUTORS\">CONTRIBUTORS<\/a><br \/> <a href=\"#COPYRIGHT AND LICENCE\">COPYRIGHT AND LICENCE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">B::Hooks::EndOfScope \u2212 Execute code after a scope finished compilation<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">version 0.24<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">on_scope_end { &#8230; };<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This module allows you to execute code when perl finished compiling the surrounding scope.<\/p>\n<h2>FUNCTIONS <a name=\"FUNCTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>on_scope_end<\/b> <br \/> on_scope_end { &#8230; }; <br \/> on_scope_end $code;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Registers $code to be executed after the surrounding scope has been compiled.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This is exported by default. See Sub::Exporter on how to customize it.<\/p>\n<h2>LIMITATIONS <a name=\"LIMITATIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Pure-perl mode caveat<\/b> <br \/> This caveat applies to <b>any<\/b> version of perl where Variable::Magic is unavailable or otherwise disabled.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">While Variable::Magic has access to some very dark sorcery to make it possible to throw an exception from within a callback, the pure-perl implementation does not have access to these hacks. Therefore, what would have been a <b>compile-time exception<\/b> is instead <b>converted to a warning<\/b>, and your execution will continue as if the exception never happened.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To explicitly request an <small>XS<\/small> (or <small>PP<\/small> ) implementation one has two choices. Either to import from the desired implementation explicitly:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">use B::Hooks::EndOfScope::XS <br \/> or <br \/> use B::Hooks::EndOfScope::PP<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">or by setting $ENV{B_HOOKS_ENDOFSCOPE_IMPLEMENTATION} to either &#8220;XS&#8221; or &#8220;PP&#8221;.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Perl 5.8.0 ~ 5.8.3<\/b> <br \/> Due to a core interpreter bug <br \/> <https:\/\/rt.perl.org\/Public\/Bug\/Display.html?id=27040#txn-82797> present in older perl versions, the implementation of B::Hooks::EndOfScope deliberately leaks a single empty hash for every scope being cleaned. This is done to avoid the memory corruption associated with the bug mentioned above.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In order to stabilize this workaround use of Variable::Magic is disabled on perls prior to version 5.8.4. On such systems loading\/requesting B::Hooks::EndOfScope::XS explicitly will result in a compile-time exception.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Perl versions 5.6.x<\/b> <br \/> Versions of perl before 5.8.0 lack a feature allowing changing the visibility of &#8220;%^H&#8221; via setting bit 17 within $^H. As such the only way to achieve the effect necessary for this module to work, is to use the &#8220;local&#8221; operator explicitly on these platforms. This might lead to unexpected interference with other scope-driven libraries relying on the same mechanism. On the flip side there are no such known incompatibilities at the time this note was written.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For further details on the unavailable behavior please refer to the test file <i>t\/02\u2212localise.t<\/i> included with the distribution.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Sub::Exporter<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Variable::Magic<\/p>\n<h2>SUPPORT <a name=\"SUPPORT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Bugs may be submitted through the <small>RT<\/small> bug tracker <https:\/\/rt.cpan.org\/Public\/Dist\/Display.html?Name=B-Hooks-EndOfScope> (or bug\u2212B\u2212Hooks\u2212EndOfScope@rt.cpan.org <mailto:bug-B-Hooks-EndOfScope@rt.cpan.org>).<\/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=\"60%\">\n<p style=\"margin-top: 1em\">Florian Ragwitz <rafl@debian.org><\/p>\n<\/td>\n<td width=\"23%\"> <\/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=\"60%\">\n<p>Peter Rabbitson <ribasushi@leporine.io><\/p>\n<\/td>\n<td width=\"23%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>CONTRIBUTORS <a name=\"CONTRIBUTORS\"><\/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=\"74%\">\n<p style=\"margin-top: 1em\">Karen Etheridge <ether@cpan.org><\/p>\n<\/td>\n<td width=\"9%\"> <\/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=\"74%\">\n<p>Tatsuhiko Miyagawa <miyagawa@bulknews.net><\/p>\n<\/td>\n<td width=\"9%\"> <\/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=\"74%\">\n<p>Christian Walde <walde.christian@googlemail.com><\/p>\n<\/td>\n<td width=\"9%\"> <\/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=\"74%\">\n<p>Tomas Doran <bobtfish@bobtfish.net><\/p>\n<\/td>\n<td width=\"9%\"> <\/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=\"74%\">\n<p>Graham Knop <haarg@haarg.org><\/p>\n<\/td>\n<td width=\"9%\"> <\/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=\"74%\">\n<p>Simon Wilper <sxw@chronowerks.de><\/p>\n<\/td>\n<td width=\"9%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>COPYRIGHT AND LICENCE <a name=\"COPYRIGHT AND LICENCE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This software is copyright (c) 2008 by Florian Ragwitz.<\/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>  B::Hooks::EndOfScope \u2212 Execute code after a scope finished compilation <\/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":[3754,3007],"class_list":["post-7442","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-bhooksendofscope","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7442","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=7442"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7442\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}