home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / Global.pm < prev    next >
Encoding:
Perl POD Document  |  2004-09-23  |  3.8 KB  |  202 lines

  1. # /*
  2. #  * *********** WARNING **************
  3. #  * This file generated by ModPerl::WrapXS/0.01
  4. #  * Any changes made here will be lost
  5. #  * ***********************************
  6. #  * 01: lib/ModPerl/Code.pm:701
  7. #  * 02: O:\147xampp\sources\mod_perl-1.99_16\blib\lib/ModPerl/WrapXS.pm:584
  8. #  * 03: O:\147xampp\sources\mod_perl-1.99_16\blib\lib/ModPerl/WrapXS.pm:1100
  9. #  * 04: Makefile.PL:335
  10. #  * 05: Makefile.PL:283
  11. #  * 06: Makefile.PL:51
  12. #  */
  13.  
  14.  
  15. package ModPerl::Global;
  16.  
  17. use strict;
  18. use warnings FATAL => 'all';
  19.  
  20.  
  21.  
  22. use Apache::XSLoader ();
  23. our $VERSION = '0.01';
  24. Apache::XSLoader::load __PACKAGE__;
  25.  
  26.  
  27.  
  28. 1;
  29. __END__
  30.  
  31. =head1 NAME
  32.  
  33. ModPerl::Global -- Perl API for manipulating special Perl lists
  34.  
  35.  
  36.  
  37.  
  38. =head1 Synopsis
  39.  
  40.   use ModPerl::Global ();
  41.   my $package = 'MyApache::Package';
  42.   
  43.   # make the END blocks of this package special
  44.   ModPerl::Global::special_list_register(END => $package);
  45.   
  46.   # Execute all encoutered END blocks from this package now
  47.   ModPerl::Global::special_list_call(    END => $package);
  48.   
  49.   # delete the list of END blocks
  50.   ModPerl::Global::special_list_clear(   END => $package);
  51.  
  52.  
  53.  
  54.  
  55. =head1 Description
  56.  
  57. C<ModPerl::Global> provides an API to manipulate special perl
  58. lists. At the moment only the C<END> blocks list is supported.
  59.  
  60. This API allows you to change the normal Perl behavior, and execute
  61. special lists when you need to.
  62.  
  63. For example
  64. C<L<ModPerl::RegistryCooker|docs::2.0::api::ModPerl::RegistryCooker>>
  65. uses it to run C<END> blocks in the scripts at the end of each
  66. request.
  67.  
  68. Before loading a module containing package C<$package>, you need to
  69. register it, so the special blocks will be intercepted by mod_perl and
  70. not given to
  71. Perl. C<L<special_list_register|/C_special_list_register_>> does
  72. that. Later on when you want to execute the special blocks,
  73. C<L<special_list_call|/C_special_list_call_>> should be called. Unless
  74. you want to call the list more than once, clear the list with
  75. C<L<special_list_clear|/C_special_list_clear_>>.
  76.  
  77. =head1 API
  78.  
  79. C<ModPerl::Global> provides the following methods:
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. =head2 C<special_list_call>
  91.  
  92. Call the special list
  93.  
  94.   $ok = special_list_call($key => $package);
  95.  
  96. =over 4
  97.  
  98. =item arg1: C<$key> ( string )
  99.  
  100. The name of the special list. At the moment only C<'END'> is
  101. supported.
  102.  
  103. =item arg2: C<$package> ( string )
  104.  
  105. what package to special list is for
  106.  
  107. =item ret: C<$ok> ( boolean )
  108.  
  109. true value if C<$key> is known, false otherwise.
  110.  
  111. =item since: 1.99_14
  112.  
  113. =back
  114.  
  115.  
  116.  
  117.  
  118.  
  119. =head2 C<special_list_clear>
  120.  
  121. Clear the special list
  122.  
  123.   $ok = special_list_clear($key => $package);
  124.  
  125. =over 4
  126.  
  127. =item arg1: C<$key> ( string )
  128.  
  129. The name of the special list. At the moment only C<'END'> is
  130. supported.
  131.  
  132. =item arg2: C<$package> ( string )
  133.  
  134. what package to special list is for
  135.  
  136. =item ret: C<$ok> ( boolean )
  137.  
  138. true value if C<$key> is known, false otherwise.
  139.  
  140. =item since: 1.99_14
  141.  
  142. =back
  143.  
  144.  
  145.  
  146.  
  147. =head2 C<special_list_register>
  148.  
  149. Register the special list
  150.  
  151.   $ok = special_list_call($key => $package);
  152.  
  153. =over 4
  154.  
  155. =item arg1: C<$key> ( string )
  156.  
  157. The name of the special list. At the moment only C<'END'> is
  158. supported.
  159.  
  160. =item arg2: C<$package> ( string )
  161.  
  162. what package to special list is for
  163.  
  164. =item ret: C<$ok> ( boolean )
  165.  
  166. true value if C<$key> is known, false otherwise.
  167.  
  168. =item since: 1.99_14
  169.  
  170. =back
  171.  
  172. Notice that you need to register the package before it is loaded. If
  173. you register it after, Perl has already compiled the C<END> blocks and
  174. there are no longer under your control.
  175.  
  176.  
  177.  
  178. =head1 See Also
  179.  
  180. L<mod_perl 2.0 documentation|docs::2.0::index>.
  181.  
  182.  
  183.  
  184.  
  185. =head1 Copyright
  186.  
  187. mod_perl 2.0 and its core modules are copyrighted under
  188. The Apache Software License, Version 2.0.
  189.  
  190.  
  191.  
  192.  
  193. =head1 Authors
  194.  
  195. L<The mod_perl development team and numerous
  196. contributors|about::contributors::people>.
  197.  
  198. =cut
  199.  
  200.