You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Beau E. Cox" <be...@beaucox.com> on 2002/12/05 11:26:24 UTC

[mp2] doing PerlSetVar from a startup handler

Hi -

I'm trying to get mason running under mod_perl 2,
but this is a mod_perl question. I need to have the
following set:

PerlSetVar  MasonArgsMethod  CGI

When I configure mason in httpd.conf w/o a startup handler,
everything is fine.

With a handler, even with the PerlSetVar before the
'require' for the handler in the conf file, CGI is NOT
set.

Question: how can I PerlSetVar from the perl code in the
handler? I see:

push @{ $Location{"/"}->{PerlSetVar} }, [ foo => 'bar' ];

in the mp1 docs - looks good - but where do I get the %Location
hash? Can't seem to find that.

Aloha => Beau.


RE: [mp2] doing PerlSetVar from a startup handler

Posted by "Beau E. Cox" <be...@beaucox.com>.
Stas -

I finally found what was happening; the startup script
(which I miscalled a 'handler') invoked by a 'PerlRequire'
directive in httpd.conf creates, among other things, a 
HTML::Mason::ApacheHandler object. One of the arguments
to it's new constructor is 'args_method', which, when
set to 'CGI' uses CGI instead of Apache::Request. I don't
know how the magic of the PerlSetVar => args_method when
mason is configured w/o a startup script, but the point
is mute, as it is up and running.

I will ponder further after my deadlines are met ;)

Aloha => Beau.

PS: why do I always get two duplicate messages from you?

PPS:

HOURLY WEATHER
100 AM HST THU DEC 5 2002 
OAHU-  
CITY     SKY/WX TMP  DP  RH WIND  PRES
HONOLULU  CLEAR  68  63  84  NW3  30.04F 

Chilly tonight!!!

-----Original Message-----
From: Stas Bekman [mailto:stas@stason.org]
Sent: Thursday, December 05, 2002 12:48 AM
To: Beau E. Cox
Cc: Modperl
Subject: Re: [mp2] doing PerlSetVar from a startup handler


Beau E. Cox wrote:
> Hi -
> 
> I'm trying to get mason running under mod_perl 2,
> but this is a mod_perl question. I need to have the
> following set:
> 
> PerlSetVar  MasonArgsMethod  CGI
> 
> When I configure mason in httpd.conf w/o a startup handler,
> everything is fine.

What do you mean by the "startup handler"? a startup file?

> With a handler, even with the PerlSetVar before the
> 'require' for the handler in the conf file, CGI is NOT
> set.

I'm not familiar with mason, so please provide a short example that 
reproduces the problem (w/o mason if possible).

> Question: how can I PerlSetVar from the perl code in the
> handler? I see:
> 
> push @{ $Location{"/"}->{PerlSetVar} }, [ foo => 'bar' ];
> 
> in the mp1 docs - looks good - but where do I get the %Location
> hash? Can't seem to find that.

In 1.0 outside <Perl> you would go as:

   package Apache::ReadConfig;
   push @{ $Location{"/"}->{PerlSetVar} }, [ foo => 'bar' ];

but 2.0's support Perl sections support is incomplete as far as I know. 
Doug implemented the base and Philippe was working on the rest, but he 
is on vacation now, so expect him to complete it once he comes back (in 
January I believe)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: [mp2] doing PerlSetVar from a startup handler

Posted by Stas Bekman <st...@stason.org>.
Beau E. Cox wrote:
> Hi -
> 
> I'm trying to get mason running under mod_perl 2,
> but this is a mod_perl question. I need to have the
> following set:
> 
> PerlSetVar  MasonArgsMethod  CGI
> 
> When I configure mason in httpd.conf w/o a startup handler,
> everything is fine.

What do you mean by the "startup handler"? a startup file?

> With a handler, even with the PerlSetVar before the
> 'require' for the handler in the conf file, CGI is NOT
> set.

I'm not familiar with mason, so please provide a short example that 
reproduces the problem (w/o mason if possible).

> Question: how can I PerlSetVar from the perl code in the
> handler? I see:
> 
> push @{ $Location{"/"}->{PerlSetVar} }, [ foo => 'bar' ];
> 
> in the mp1 docs - looks good - but where do I get the %Location
> hash? Can't seem to find that.

In 1.0 outside <Perl> you would go as:

   package Apache::ReadConfig;
   push @{ $Location{"/"}->{PerlSetVar} }, [ foo => 'bar' ];

but 2.0's support Perl sections support is incomplete as far as I know. 
Doug implemented the base and Philippe was working on the rest, but he 
is on vacation now, so expect him to complete it once he comes back (in 
January I believe)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com