13
16
ModPerl::Util::untaint($) # secret API?
17
23
C<ModPerl::Util> provides mod_perl 2.0 util functions.
23
=item * current_callback
25
Returns the currently running callback, like 'PerlResponseHandler'
29
Used internally to replace CORE::exit and terminate the request,
30
not the current process.
31
C<ModPerl::Util> provides the following functions and/or methods:
38
Untaint the variable, by turning its tainted bit off (used internally).
44
=item arg1: C<$var> (scalar)
46
=item ret: no return value
50
Do not use this function unless you know what you are doing. To learn
51
how to properly untaint variables refer to the I<perlsec> manpage.
54
=head2 C<current_callback>
56
Returns the currently running callback, like 'PerlResponseHandler'.
58
$callback = Apache::current_callback();
62
=item ret: C<$callback> (string)
72
Terminate the request, but not the current process (or not the current
73
Perl interpreter with threaded mpms).
75
ModPerl::Util::exit($status);
79
=item opt arg1: C<$status> (integer)
81
The exit status, which as of this writing is ignored.
83
=item ret: no return value
89
Normally you will use the plain C<exit()> in your code. You don't need
90
to use C<ModPerl::Util::exit> explicitly, since mod_perl overrides
91
C<exit()> by setting C<CORE::GLOBAL::exit> to
92
C<ModPerl::Util::exit>. Only if you redefine C<CORE::GLOBAL::exit>
93
once mod_perl is running, you may want to use this function.
95
The original C<exit()> is still available via C<CORE::exit()>.
97
C<ModPerl::Util::exit> is implemented as a special C<die()> call,
98
therefore if you call it inside C<eval BLOCK> or C<eval "STRING">,
99
while an exception is being thrown, it is caught by C<eval>. For
103
print "Still running";
105
will not print anything. But:
110
print "Still running";
112
will print I<Still running>. So you either need to check whether L<the
113
exception|docs::2.0::api::APR::Error> is specific to C<exit> and call
116
use ModPerl::Const -compile => 'EXIT';
120
exit if $@ && ref $@ eq 'APR::Error' && $@ == ModPerl::EXIT;
121
print "Still running";
123
or use C<CORE::exit()>:
128
print "Still running";
130
and nothing will be printed. The problem with the latter is the
131
current process (or a Perl Interpreter) will be killed; something that
132
you really want to avoid under mod_perl.
137
L<mod_perl 2.0 documentation|docs::2.0::index>.
144
mod_perl 2.0 and its core modules are copyrighted under
145
The Apache Software License, Version 1.1.
152
L<The mod_perl development team and numerous
153
contributors|about::contributors::people>.