This is a multi-part message in MIME format.
------_=_NextPart_001_01CB9983.C5E78882
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi
I am migrating a web application from mod_perl 1.21 to mod_perl 2.0.4,
Apache 1.3.9 to 2.2.17 and Perl5.005 to Perl5.12.2 . Operating system is
Sun Solaris 9.
The problem is that in most places the %ENV variable is used to pass
parameters to programs called via "system". Now these variables are not
found in the called program.
E.g.
Program 1 sets $ENV{XX) =3D "YY"; and executes "system
programme2.pl", but programme2.pl does not found $ENV{XX}.
Any workaround? (The question is discussed in the documentation, but I
cannot find any concrete solution). I have gone through the following
link as well
http://perl.apache.org/docs/2.0/user/troubleshooting/trouble shooting.htm
l#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code. Here it says
environ is not tied in mp2 due to threads issues. In our application we
are using ENV in so many places with different values for different
users logged into an application, so it is not possible to set up the
values at start up.
Test programs:
Program 1 (main)
#!/usr/bin/perl -w
use strict;
print "Content-type: text/plain\n\n";
$ENV{XX} =3D "YY";
for (sort keys %ENV) {
print "\tENV{$_} =3D> $ENV{$_}\n";
}
system ("/home/user/programme2.pl");
exit 0;
Program 2
#!/usr/bin/perl -w
use strict;
use FileHandle;
my $fh =3D new FileHandle;
$fh->open (">/var/tmp/p2.log") or die "can't open file";
for (sort keys %ENV) {
$fh->print ("\2. ENV{$_} =3D> $ENV{$_}\n");
}
$fh->close;
exit 0;
I tried to use Env::C module, but while installing make test is failed.
Below is the make test output.
Can't load 'blib/arch/auto/Env/C/C.so' for module Env::C: ld.so.1: perl:
fatal: relocation error: file blib/arch/auto/Env/C/C.so: symbol setenv:
referenced symbol not found at
~/lib/perl5/5.12.2/sun4-solaris-64int/DynaLoader.pm line 200
Irrespective of test result I have installed this module and tried to
set the env variable then I am getting the same error.
ld.so.1: perl: fatal: relocation error: file
~/lib/perl5/site_perl/5.12.2/sun4-solaris-64int/auto/Env/C/C .so: symbol
setenv: referenced symbol not found
Thank you in advance for your help and please let me know if any
additional information required.
Regards
Sudhakar
------_=_NextPart_001_01CB9983.C5E78882
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/mee tings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/x ml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/oi s/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/di rectory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/20 02/1/alerts/"=
xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/partto part" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/wor kflow/" =
xmlns:dsss=3D"http://schemas.microsoft.com/office/2006/digsi g-setup" =
xmlns:dssi=3D"http://schemas.microsoft.com/office/2006/digsi g" =
xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/200 6/digital-sig=
nature" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compa tibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/200 6/relationshi=
ps" xmlns:spwp=3D"http://microsoft.com/sharepoint/webpartpages" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/2006/types"=
=
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/2006/messag=
es" =
xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ SlideLibrary/=
" =
xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor talServer/Pub=
lishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" =
xmlns:st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Arial","sans-serif";
color:blue;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Arial","sans-serif";
color:#000099;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Hi<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>I am migrating a web application from mod_perl 1.21 to =
mod_perl 2.0.4,
Apache 1.3.9 to 2.2.17 and Perl5.005 to Perl5.12.2 . Operating system is =
Sun
Solaris 9.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>The problem is that in most places the %ENV variable is used =
to
pass parameters to programs called via "system". Now these =
variables
are not found in the called program. <o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>E.g. <o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Program 1 sets $ENV{XX) =3D “YY”; and executes =
"system <o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>programme2.pl", but programme2.pl does not found =
$ENV{XX}.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Any workaround? (The question is discussed in the =
documentation,
but I cannot find any concrete solution). I have gone through the =
following
link as well <a
href=3D"http://perl.apache.org/docs/2.0/user/troubleshooting /troubleshoot=
ing.html#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_C ode">http://p=
erl.apache.org/docs/2.0/user/troubleshooting/troubleshooting .html#C_Libra=
ries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code</a>.
Here it says environ is not tied in mp2 due to threads issues. In our
application we are using ENV in so many places with different values for
different users logged into an application, so it is not possible to set =
up the
values at start up.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><b><u><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>Test =
programs:<o:p></o:p></span></u></b></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'><o:p> </o:p></span><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><b><u><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>Program 1 =
(main)<o:p></o:p></span></u></b></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'><o:p> </o:p></span><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>#!/usr/bin/p erl =
-w<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>use =
strict;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>print =
"Content-type:
text/plain\n\n";<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'><o:p> </o:p></span><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>$ENV{XX} =3D =
“YY”;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>for (sort keys %ENV) =
{<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'> &=
nbsp;
print "\tENV{$_} =3D> $ENV{$_}\n";<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>}<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>system
(“/home/user/programme2.pl”);<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>exit =
0;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'><o:p> </o:p></span><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><b><u><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>Program =
2<o:p></o:p></span></u></b></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'><o:p> </o:p></span><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>#!/usr/bin/p erl =
-w<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>use =
strict;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>use =
FileHandle;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'><o:p> </o:p></span><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>my $fh =3D new =
FileHandle;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>$fh->open
(">/var/tmp/p2.log") or die “can’t open =
file”;<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>for (sort keys %ENV) =
{<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'> &=
nbsp;
$fh->print ("\2. ENV{$_} =3D> =
$ENV{$_}\n");<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>}<o:p></o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>$fh->close;<o:p></o:p>=
</span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:#00B050'>exit =
0;<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>I tried to use Env::C module, but while installing make test =
is
failed. Below is the make test output.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:red'>Can't load
'blib/arch/auto/Env/C/C.so' for module Env::C: ld.so.1: perl: fatal: =
relocation
error: file blib/arch/auto/Env/C/C.so: symbol setenv: referenced symbol =
not
found at ~/lib/perl5/5.12.2/sun4-solaris-64int/DynaLoader.pm line =
200<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Irrespective of test result I have installed this module and =
tried
to set the env variable then I am getting the same =
error.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
style=3D'font-size:10.0pt;
font-family:"Arial","sans-serif";color:red'>ld.so.1: perl: fatal: =
relocation
error: file =
~/lib/perl5/site_perl/5.12.2/sun4-solaris-64int/auto/Env/C/C .so:
symbol setenv: referenced symbol not found<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Thank you in advance for your help and please let me know if =
any
additional information required.<o:p></o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span =
style=3D'color:blue'>Regards<o:p></o:p></span></p>
<p class=3DMsoNormal><b><span =
style=3D'color:blue'>Sudhakar<o:p></o:p></span></b></p>
<p class=3DMsoNormal><o:p> </o:p></p>
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'><o:p> </o:p></span></p>
</div>
</body>
</html>
------_=_NextPart_001_01CB9983.C5E78882--
