1docs::api::ModPerl::GloUbsaelr(3C)ontributed Perl Documednotcast:i:oanpi::ModPerl::Global(3)
2
3
4

NAME

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

Synopsis

9         use ModPerl::Global ();
10         my $package = 'MyApache2::Package';
11
12         # make the END blocks of this package special
13         ModPerl::Global::special_list_register(END => $package);
14
15         # Execute all encoutered END blocks from this package now
16         ModPerl::Global::special_list_call(    END => $package);
17
18         # delete the list of END blocks
19         ModPerl::Global::special_list_clear(   END => $package);
20

Description

22       "ModPerl::Global" provides an API to manipulate special perl lists. At
23       the moment only the "END" blocks list is supported.
24
25       This API allows you to change the normal Perl behavior, and execute
26       special lists when you need to.
27
28       For example "ModPerl::RegistryCooker" uses it to run "END" blocks in
29       the scripts at the end of each request.
30
31       Before loading a module containing package $package, you need to regis‐
32       ter it, so the special blocks will be intercepted by mod_perl and not
33       given to Perl. "special_list_register" does that. Later on when you
34       want to execute the special blocks, "special_list_call" should be
35       called. Unless you want to call the list more than once, clear the list
36       with "special_list_clear".
37

API

39       "ModPerl::Global" provides the following methods:
40
41       "special_list_call"
42
43       Call the special list
44
45         $ok = special_list_call($key => $package);
46
47       arg1: $key ( string )
48           The name of the special list. At the moment only 'END' is sup‐
49           ported.
50
51       arg2: $package ( string )
52           what package to special list is for
53
54       ret: $ok ( boolean )
55           true value if $key is known, false otherwise.
56
57       since: 2.0.00
58
59       "special_list_clear"
60
61       Clear the special list
62
63         $ok = special_list_clear($key => $package);
64
65       arg1: $key ( string )
66           The name of the special list. At the moment only 'END' is sup‐
67           ported.
68
69       arg2: $package ( string )
70           what package to special list is for
71
72       ret: $ok ( boolean )
73           true value if $key is known, false otherwise.
74
75       since: 2.0.00
76
77       "special_list_register"
78
79       Register the special list
80
81         $ok = special_list_call($key => $package);
82
83       arg1: $key ( string )
84           The name of the special list. At the moment only 'END' is sup‐
85           ported.
86
87       arg2: $package ( string )
88           what package to special list is for
89
90       ret: $ok ( boolean )
91           true value if $key is known, false otherwise.
92
93       since: 2.0.00
94
95       Notice that you need to register the package before it is loaded. If
96       you register it after, Perl has already compiled the "END" blocks and
97       there are no longer under your control.
98

See Also

100       mod_perl 2.0 documentation.
101
103       mod_perl 2.0 and its core modules are copyrighted under The Apache
104       Software License, Version 2.0.
105

Authors

107       The mod_perl development team and numerous contributors.
108
109
110
111perl v5.8.8                       2006-11-19     docs::api::ModPerl::Global(3)
Impressum