You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Geronimo <ge...@clerkin.co.uk> on 2006/09/15 22:38:05 UTC
Re: passing an argument to startup.pl - RESOLVED
Many thanks to Jonathan Vanasco and Jeff Noakes for their respective solutions to this problem. I've implemented both; Jonathan's on a production unix server and Jeff's on a Win32 test box where apache runs as a service.
Very helpful.
Best Regards,
Gerard
# "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
----- Original Message -----
From: Geronimo
To: modperl@perl.apache.org
Sent: Thursday, September 14, 2006 9:58 PM
Subject: passing an argument to startup.pl
PROBLEM:
I need to pass an argument to startup.pl, 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/startup.pl dv1
I've tried various things, like quoting the call to startup.pl in httpd.conf;
PerlRequire "/devel/startup.pl 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.
SOLUTION:
None so far, except this workaround
# in http.conf:
# fake addition to @INC
PerlSwitches -I/devel/dv1
PerlRequire "/devel/startup.pl"
# in startup.pl
.. pull /devel/dv1 off @INC with a grep
Any suggestions of a more worthy solution would be appreciated.
Thanks,
Gerard
# "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