You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by kh...@wipro.com on 2006/10/18 12:00:02 UTC

Reading PerlSetVar in mod_perl2

Hi All,

I asked the same question before but with not much help so I am asking
it again, The below configuration is added to a configuration file and
that is included in httpd.conf

<Location /someurl>
  SSLRequireSSL
  SetHandler            perl-script
  PerlHandler           Apache::Hello
  PerlSetVar            somevar1 1
  PerlSetVar            somevar2 2
  PerlSetVar            somevar3 3
  PerlSetVar            somevar4 4
</Location>

In the handler Hello, I was able to read all the variables set using
PerlSetVar in apache 1.3 however in apache 2.0 (mod_perl 2) I am getting
blank(null) whenever I read the values from Handler using (
$r->dir_config('somevar1') etc) Can you please let me know possibilies
where it could go wrong, I searched the web but with no great help.

Thanks



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Re: Reading PerlSetVar in mod_perl2

Posted by Perrin Harkins <pe...@elem.com>.
On Wed, 2006-10-18 at 15:30 +0530, khan.sajid@wipro.com wrote:

> <Location /someurl>
>   SSLRequireSSL
>   SetHandler            perl-script
>   PerlHandler           Apache::Hello
>   PerlSetVar            somevar1 1
>   PerlSetVar            somevar2 2
>   PerlSetVar            somevar3 3
>   PerlSetVar            somevar4 4
> </Location>

All of that looks fine.

> In the handler Hello, I was able to read all the variables set using
> PerlSetVar in apache 1.3 however in apache 2.0 (mod_perl 2) I am
> getting blank(null) whenever I read the values from Handler using
> ( $r->dir_config('somevar1') etc) Can you please let me know
> possibilies where it could go wrong, I searched the web but with no
> great help.

Most likely you are not actually in the Location block that you think
you're in.  There's probably something wrong with another part of your
conf file which is preventing the request from actually being handled by
this block.

- Perrin