Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

TheboL.wwwxxxxx, WWWXXXAPC , wwwxxn.xsss, wwwxxxapc, WWWXXX.VCBA, wwwxxx vba, wwwxxxdoco, Wwwxxx.APC, wwwxxx CN2, can't locate feature.pm in @inc (@inc contains

Links

XODOX
Impressum

#1: passing an argument to startup.pl

Posted on 2006-09-14 22:58:58 by Geronimo

This is a multi-part message in MIME format.

------=_NextPart_000_0074_01C6D848.FAE00C70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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'.=20
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:=20
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

------=_NextPart_000_0074_01C6D848.FAE00C70
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>PROBLEM:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I need to pass an argument to =
startup.pl,&nbsp;in=20
order</FONT><FONT face=3DArial size=3D2>&nbsp;to associate Apache2 with =
a specific=20
version of an app. The app version has a simple identifier, say 'dv1'.=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I'm trying to do is emulate =
passing an=20
argument on the command line, which will show up in @ARGV, =
like;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$ /devel/startup.pl dv1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've tried various things, like quoting =
the call to=20
startup.pl in httpd.conf;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PerlRequire "/devel/startup.pl =
dv1"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>which doesn't work, as PerlRequire sees =
dv1 as a=20
second argument to itself. All the methods I've looked at for setting=20
environment variables don't get visibility until the server is up and =
running,=20
which is fair enough.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SOLUTION: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>None so far, except this =
workaround</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># in http.conf:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># fake addition to @INC</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PerlSwitches -I/devel/dv1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PerlRequire =
"/devel/startup.pl"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># in startup.pl</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.. pull /devel/dv1 off @INC with a=20
grep</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Any suggestions of a more worthy =
solution would be=20
appreciated.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Gerard</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># "Be who you are and say what you =
feel, because=20
those who mind don't matter and those who matter don't mind."<BR># =
&nbsp; - Dr.=20
Seuss</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0074_01C6D848.FAE00C70--

Report this message

#2: Re: passing an argument to startup.pl

Posted on 2006-09-14 23:46:25 by Jeff Nokes

--0-734813493-1158270385=:24360
Content-Type: text/plain; charset=us-ascii

I guess you could try to do something dynamic with <Perl> blocks in your httpd.conf ...

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

then within startup.pl you do ...

use Startup; (or require "Startup.pm")
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 <gerard@clerkin.co.uk>
To: modperl@perl.apache.org
Sent: Thursday, September 14, 2006 1:58: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





--0-734813493-1158270385=:24360
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:system;font-size:12pt"><div style="font-family: system; font-size: 12pt;">I guess you could try to do something dynamic with &lt;Perl&gt; blocks in your httpd.conf ...<br><br>&lt;Perl&gt;<br>&nbsp;&nbsp;&nbsp; open(NEW_MODULE, '&gt;Startup.pm');<br>&nbsp;&nbsp;&nbsp; print NEW_MODULE (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "package Startup;\n" .<br>&nbsp;&nbsp;&nbsp; &nbsp; "our $arg_1 = 'dv1';<br>&nbsp;&nbsp;&nbsp; );<br>&lt;/Perl&gt;<br><br>then within startup.pl you do ...<br><br>use Startup;&nbsp; (or require "Startup.pm")<br>if($Startup::arg_1 eq 'dv1')<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp; #do something ...<br>&nbsp; }<br><br>I've never done anything like this but it should work, in theory (I think :-)<br>- Jeff<br><br><br><div style="font-family: times new roman,new york,times,s
erif; font-size: 12pt;">----- Original Message ----<br>From: Geronimo
&lt;gerard@clerkin.co.uk&gt;<br>To: modperl@perl.apache.org<br>Sent: Thursday, September 14, 2006 1:58:58 PM<br>Subject: passing an argument to startup.pl<br><br>



<style></style>
<div><font face="Arial" size="2">PROBLEM:</font></div>
<div><font face="Arial" size="2">I need to pass an argument to startup.pl,&nbsp;in
order</font><font face="Arial" size="2">&nbsp;to associate Apache2 with a specific
version of an app. The app version has a simple identifier, say 'dv1'.
</font></div>
<div><font face="Arial" size="2">What I'm trying to do is emulate passing an
argument on the command line, which will show up in @ARGV, like;</font></div>
<div><font face="Arial" size="2">$ /devel/startup.pl dv1</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">I've tried various things, like quoting the call to
startup.pl in httpd.conf;</font></div>
<div><font face="Arial" size="2">PerlRequire "/devel/startup.pl dv1"</font></div>
<div><font face="Arial" size="2">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.</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">SOLUTION: </font></div>
<div><font face="Arial" size="2">None so far, except this workaround</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2"># in http.conf:</font></div>
<div><font face="Arial" size="2"># fake addition to @INC</font></div>
<div><font face="Arial" size="2">PerlSwitches -I/devel/dv1</font></div>
<div><font face="Arial" size="2">PerlRequire "/devel/startup.pl"</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2"># in startup.pl</font></div>
<div><font face="Arial" size="2">.. pull /devel/dv1 off @INC with a
grep</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">Any suggestions of a more worthy solution would be
appreciated.</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">Thanks,</font></div>
<div><font face="Arial" size="2">Gerard</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2"># "Be who you are and say what you feel, because
those who mind don't matter and those who matter don't mind."<br># &nbsp; - Dr.
Seuss</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div></div><br></div></div></body></html>
--0-734813493-1158270385=:24360--

Report this message

#3: Re: passing an argument to startup.pl

Posted on 2006-09-14 23:58:58 by jonathan vanasco

On Sep 14, 2006, at 4:58 PM, Geronimo wrote:

> 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

use $ENV

either set it on the command line, do some fancy stuff with
apachectl's -D , or include multiple apachectl files

or 2/3 all at once! ( just to show how )

apachectl -D dv1 start

httpd.conf
<ifDefine dv1>
include startup_dv1.pl
</ifDefine>

include startup.pl


startup_dv1.pl
do some specific dv1 stuff here
$ENV{'myAppServer'}= 'dv1

startup.pl
if ( $ENV{'myAppServer'} eq 'dv1 ) {
etc
}

I personally
make heavy use of -D to handle server versions ( so the same
startup.pl and httpd.conf work on OSX , ubuntu and FreeBSD )
include a per-server version of startup.pl, before including
startup.pl , so i have the right things for the right os
set $env within perl for server specific code

Report this message

#4: Re: passing an argument to startup.pl - RESOLVED

Posted on 2006-09-15 22:38:05 by Geronimo

This is a multi-part message in MIME format.

------=_NextPart_000_004B_01C6D90F.3A551870
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 -----=20
From: Geronimo=20
To: modperl@perl.apache.org=20
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'.=20
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:=20
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

------=_NextPart_000_004B_01C6D90F.3A551870
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Many thanks to Jonathan Vanasco and =
Jeff Noakes for=20
their respective solutions to this problem. </FONT><FONT face=3DArial =
size=3D2>I've=20
implemented both; </FONT><FONT face=3DArial size=3D2>Jonathan's on a =
production unix=20
server and Jeff's on a Win32 test box where apache runs as a=20
service.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Very helpful.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Gerard</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># "Be who you are and say what you =
feel, because=20
those who mind don't matter and those who matter don't mind."<BR># =
&nbsp; - Dr.=20
Seuss</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3Dgerard@clerkin.co.uk =
href=3D"mailto:gerard@clerkin.co.uk">Geronimo</A>=20
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dmodperl@perl.apache.org=20
href=3D"mailto:modperl@perl.apache.org">modperl@perl.apache. org</A> =
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, September 14, =
2006 9:58=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> passing an argument to =

startup.pl</DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>PROBLEM:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I need to pass an argument to =
startup.pl,&nbsp;in=20
order</FONT><FONT face=3DArial size=3D2>&nbsp;to associate Apache2 =
with a specific=20
version of an app. The app version has a simple identifier, say 'dv1'. =

</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I'm trying to do is emulate =
passing an=20
argument on the command line, which will show up in @ARGV, =
like;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$ /devel/startup.pl dv1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've tried various things, like =
quoting the call=20
to startup.pl in httpd.conf;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PerlRequire "/devel/startup.pl =
dv1"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>which doesn't work, as PerlRequire =
sees dv1 as a=20
second argument to itself. All the methods I've looked at for setting=20
environment variables don't get visibility until the server is up and =
running,=20
which is fair enough.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SOLUTION: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>None so far, except this =
workaround</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># in http.conf:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># fake addition to @INC</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PerlSwitches =
-I/devel/dv1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PerlRequire =
"/devel/startup.pl"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># in startup.pl</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.. pull /devel/dv1 off @INC with a=20
grep</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Any suggestions of a more worthy =
solution would=20
be appreciated.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Gerard</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># "Be who you are and say what you =
feel, because=20
those who mind don't matter and those who matter don't mind."<BR># =
&nbsp; -=20
Dr. Seuss</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_004B_01C6D90F.3A551870--

Report this message