Apache-SSI
view release on metacpan or search on metacpan
If the 'sub' argument matches the regular expression /^\s*sub[^\w:]/, it
is assumed to be a subroutine reference. Otherwise it's assumed to be
the name of a function. In the latter case, the string "main::" will be
prepended to the function name if the name doesn't contain "::" (this
forces the function to be in the main package, or a package you
specify). Note that it's a pretty bad idea to put your code in the main
package, so I only halfheartedly endorse this feature.
In general, it will be slower to use anonymous subroutines, because each
one has to be eval()'ed and there is no caching. For best results,
pre-load any code you need in the parent process, then call it by name.
If you're calling a subroutine like "&Package::SubPack::handler", you
can omit the "handler" portion, making your directive like this:
<!--#perl sub="Package::Subpack"-->
If you want to supply a list of arguments to the function, you use
either the "arg" or the "args" parameter:
lib/Apache/SSI.pm view on Meta::CPAN
If the 'sub' argument matches the regular expression /^\s*sub[^\w:]/,
it is assumed to be a subroutine reference. Otherwise it's assumed to
be the name of a function. In the latter case, the string "main::"
will be prepended to the function name if the name doesn't contain
"::" (this forces the function to be in the main package, or a package
you specify). Note that it's a pretty bad idea to put your code in
the main package, so I only halfheartedly endorse this feature.
In general, it will be slower to use anonymous subroutines, because
each one has to be eval()'ed and there is no caching. For best
results, pre-load any code you need in the parent process, then call
it by name.
If you're calling a subroutine like "&Package::SubPack::handler", you
can omit the "handler" portion, making your directive like this:
<!--#perl sub="Package::Subpack"-->
If you want to supply a list of arguments to the function, you use either
the "arg" or the "args" parameter:
( run in 1.968 second using v1.01-cache-2.11-cpan-4e96b696675 )