perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Nokes <>
Subject Re: passing an argument to
Date Thu, 14 Sep 2006 21:46:25 GMT
I guess you could try to do something dynamic with <Perl> blocks in your httpd.conf ...

    open(NEW_MODULE, '>');
    print NEW_MODULE (
       "package Startup;\n" .
      "our $arg_1 = 'dv1';

then within you do ...

use Startup;  (or require "")
if($Startup::arg_1 eq 'dv1')
     #do something ...

I've never done anything like this but it should work, in theory (I think :-)
- Jeff

----- Original Message ----
From: Geronimo <>
Sent: Thursday, September 14, 2006 1:58:58 PM
Subject: passing an argument to

 I need to pass an argument to, in  order to associate Apache2 with a specific
 version of an app. The app version has a simple identifier, say 'dv1'.  
 What I'm trying to do is emulate passing an  argument on the command line, which will show
up in @ARGV, like;
 $ /devel/ dv1
 I've tried various things, like quoting the call to in httpd.conf;
 PerlRequire "/devel/ dv1"
 which doesn't work, as PerlRequire sees dv1 as a  second argument to itself. All the methods
I've looked at for setting  environment variables don't get visibility until the server is
up and running,  which is fair enough.
 None so far, except this workaround
 # in http.conf:
 # fake addition to @INC
 PerlSwitches -I/devel/dv1
 PerlRequire "/devel/"
 # in
 .. pull /devel/dv1 off @INC with a  grep
 Any suggestions of a more worthy solution would be  appreciated.
 # "Be who you are and say what you feel, because  those who mind don't matter and those who
matter don't mind."
#   - Dr.  Seuss

View raw message