[Catalyst] Apache's <IfDefine>

Charlie Garrison garrison at zeta.org.au
Wed Apr 15 15:52:19 GMT 2009


Good morning,

On 15/04/09 at 1:24 PM +0100, Ben Vinnerd 
<ben-catalyst at vinnerd.com> wrote:

>I pass a flag to Apache when i start it up, e.g. -Dhello. Any 
>ideas how i can check this from within a Catalyst app?

If using mod_perl, then inside your IfDefine block, do a 
PerlSetEnv (or maybe a PerlSetVar), eg:

     PerlSetEnv SERVER_MODE "test"

And then just check for key %ENV to see if the -D flag was 
applicable for that request.

The same technique should work with fast_cgi but you'll need to 
use SetEnv rather than PerlSetEnv (unless fast_cgi has 
PerlSetEnv equivalent).

Charlie

-- 
    Charlie Garrison  <garrison at zeta.org.au>
    PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt



More information about the Catalyst mailing list