[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    RE: embperl environment information
From:       "Gerald Richter" <richter () ecos ! de>
Date:       1999-02-28 19:53:46
[Download RAW message or body]

Hi,

> Is there anywhere in the environment for a piece of code to tell if it is
> being run under embperl vs. just being run under modperl? The reason I ask
> is that with embperl url-escaping returned html, I would like to
> be able to
> detect if a subroutine is called under embperl or under a
> cgi/modperl call.

As Cliff already pointed out you can turn off Embperl's escaping:

This may done localy:

[+ local $escmode = 0 ; $html->header(); +]


globaly:

[- $escmode = 0 -]

or in your config files

PerlSetEnv EMBPERL_ESCMODE 0


Currently there is no environement variables that is always set by Embperl.
You may set your own one in the config files. If you don't what to include
that PerlSetEnv statement in all your location or directory blocks, the
other way to determinate if running under Embperl is to use the caller
function:

($package) = caller ;

and the to see if $package starts with HTML::Embperl::, of course this only
works within the function that are directly called by the Embperl page.

I think it's a good idea to have some information if we are running under
Embperl, so I add such a variable (maybe a EMBPERL_VSERION) in the next
release of Embperl.

Gerald

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic