Re: difference between PerlSetEnv and <Perl>$ENV{}=</Perl> ?

Charlie Katz <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC1kbLCQ+Sdv5UWL0Tm1x-J2s85GZ3WTSTzFSURfx8B5ikq5Hw@mail.gmail.com>
Okay, I figured it was something about the library being in a different
language.

Still, can someone explain why

   PerlSetEnv  ENV_VAR /my/value

has different effects than

   <Perl>
   $ENV{ENV_VAR} = '/my/value';
   </Perl>

?



On Mon, Mar 26, 2012 at 3:30 PM, Lloyd Richardson
<[email protected]>wrote:

> Do the PerlSetEnv as you are, and use this module to ensure it is visible
> from your pgplot lib env.****
>
> ** **
>
> http://search.cpan.org/dist/Env-C/C.pm****
>
> ** **
>
> ** **
>
> *From:* [email protected] [mailto:[email protected]] *On Behalf Of *Charlie
> Katz
> *Sent:* March-26-12 2:26 PM
> *To:* [email protected]
> *Cc:* [email protected]
> *Subject:* Re: difference between PerlSetEnv and <Perl>$ENV{}=</Perl> ?***
> *
>
> ** **
>
> I have also tried using SetEnv from mod_env, and neither the Perl nor the
> PGPLOT library can see the environment variable set that way.****
>
> On Mon, Mar 26, 2012 at 2:54 PM, Randolf Richardson <[email protected]>
> wrote:****
>
> > Hi,
> >
> > My web app uses the PGPLOT module to access PGPLOT, which is a scientific
> > plotting library commonly used in my field.  It is a Fortran library,
> with
> > a C wrapper around it, which is then wrapped in Perl.  This works fine in
> > my test scripts, producing the desired graphics.
> >
> > The library requires that the environment variable PGPLOT_DIR be set so
> it
> > can find some required files.  Running from the command line, I just set
> > this in the shell, and PGPLOT works fine.  Running in Apache, I see
> > different behavior:
> >
> > When I set this in httpd.conf:
> >   PerlSetEnv PGPLOT_DIR /my/pgplot/directory
> > my Perl programs can see the value in $ENV{PGPLOT_DIR}, but the PGPLOT
> > library can't, and my code fails.
> >
> > When I set this in httpd.conf:
> >   <Perl>
> >   $ENV{PGPLOT_DIR} = q[/my/pgplot/directory];
> >   </Perl>
> > my Perl programs can't see the value in $ENV, but the PGPLOT library can,
> > and my code works.
> >
> >
> > Can someone help me understand what the difference is between these two
> > cases?
> >
> > Is the situation muddled because the PGPLOT library is a
> > Perl-wrapped-C-wrapped-Fortran library?  I'm not sure how the environment
> > passing is supposed to work.****
>
>        Try this module:
>
>                http://httpd.apache.org/docs/current/mod/mod_env.html
>
> Randolf Richardson - [email protected]
> Inter-Corporate Computer & Network Services, Inc.
> Beautiful British Columbia, Canada
> http://www.inter-corporate.com/
>
> ****
>
> ** **
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.