Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

ModPerl::Global (3)

Name

ModPerl::Global - Perl API for manipulating special Perl lists

Synopsis

use ModPerl::Global ();
my $package = 'MyApache2::Package';

# make the END blocks of this package special
ModPerl::Global::special_list_register(END => $package);

# Execute all encoutered END blocks from this package now
ModPerl::Global::special_list_call(    END => $package);

# delete the list of END blocks
ModPerl::Global::special_list_clear(   END => $package);

Description

User Contributed Perl Documentation
                                 build::sparcv9::docs::api::ModPerl::Global(3)



NAME
       ModPerl::Global -- Perl API for manipulating special Perl lists

Synopsis
         use ModPerl::Global ();
         my $package = 'MyApache2::Package';

         # make the END blocks of this package special
         ModPerl::Global::special_list_register(END => $package);

         # Execute all encoutered END blocks from this package now
         ModPerl::Global::special_list_call(    END => $package);

         # delete the list of END blocks
         ModPerl::Global::special_list_clear(   END => $package);

Description
       "ModPerl::Global" provides an API to manipulate special perl lists. At
       the moment only the "END" blocks list is supported.

       This API allows you to change the normal Perl behavior, and execute
       special lists when you need to.

       For example "ModPerl::RegistryCooker" uses it to run "END" blocks in
       the scripts at the end of each request.

       Before loading a module containing package $package, you need to
       register it, so the special blocks will be intercepted by mod_perl and
       not given to Perl. "special_list_register" does that. Later on when you
       want to execute the special blocks, "special_list_call" should be
       called. Unless you want to call the list more than once, clear the list
       with "special_list_clear".

API
       "ModPerl::Global" provides the following methods:

   "special_list_call"
       Call the special list

         $ok = special_list_call($key => $package);

       arg1: $key ( string )
           The name of the special list. At the moment only 'END' is
           supported.

       arg2: $package ( string )
           what package to special list is for

       ret: $ok ( boolean )
           true value if $key is known, false otherwise.

       since: 2.0.00

   "special_list_clear"
       Clear the special list

         $ok = special_list_clear($key => $package);

       arg1: $key ( string )
           The name of the special list. At the moment only 'END' is
           supported.

       arg2: $package ( string )
           what package to special list is for

       ret: $ok ( boolean )
           true value if $key is known, false otherwise.

       since: 2.0.00

   "special_list_register"
       Register the special list

         $ok = special_list_call($key => $package);

       arg1: $key ( string )
           The name of the special list. At the moment only 'END' is
           supported.

       arg2: $package ( string )
           what package to special list is for

       ret: $ok ( boolean )
           true value if $key is known, false otherwise.

       since: 2.0.00

       Notice that you need to register the package before it is loaded. If
       you register it after, Perl has already compiled the "END" blocks and
       there are no longer under your control.

See Also
       mod_perl 2.0 documentation.

Copyright
       mod_perl 2.0 and its core modules are copyrighted under The Apache
       Software License, Version 2.0.

Authors
       The mod_perl development team and numerous contributors.



ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+-----------------------------------------+
       |ATTRIBUTE TYPE |            ATTRIBUTE VALUE              |
       +---------------+-----------------------------------------+
       |Availability   | web/server/apache-24/module/apache-perl |
       +---------------+-----------------------------------------+
       |Stability      | Uncommitted                             |
       +---------------+-----------------------------------------+

NOTES
       Source code for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This software was built from source available at
       https://github.com/oracle/solaris-userland.  The original community
       source was downloaded from
       https://www.apache.org/dist/perl/mod_perl-2.0.12.tar.gz.

       Further information about this software can be found on the open source
       community website at https://perl.apache.org/.



perl v5.32.0                      2022-01-30