Re: Perl not allowed here

2004-08-05 Thread Philippe M. Chiasson

Stas Bekman wrote:
Evert Meulie wrote:
Hi everyone!
When trying to start Apache I get:
Syntax error on line 376 of
/usr/local/apache-freeside/conf/Apache-Freeside.conf:
Perl not allowed here
The relevant paragraph from Apache-Freeside.conf:
PerlModule HTML::Mason
Directory /usr/local/apache/htdocs/freeside-mason
Files ~ (\.cgi)
AddHandler perl-script .cgi
PerlHandler HTML::Mason
/Files
Perl
require /usr/local/etc/freeside/handler.pl;
/Perl
/Directory 

(the 'require' line is 376).
This paragraph I've cut/pasted from:
http://www.sisd.com/freeside/docs/install.html
My apache version is: Apache/2.0.50 (Unix) mod_perl/1.99_14 Perl/v5.8.4
DAV/2

Is there anyone out there who can enlighten me? I'm lost...   :-/

Evert, just take:
  Perl
  require /usr/local/etc/freeside/handler.pl;
  /Perl
out of the directory container and it will work.
Philippe, has the allowed placement of Perl sections changed in mp2?
For now, Perl sections are still limited to server scope. I have a patch
to open that up to OR_ALL (Location .htaccess and all) but I am not sure
of exactly what behaviour a user would expect from a Perl section in a
Location  container. For example
Location /foo
  Perl
$Global::SomeVar = 'foo';
  /Perl
/Location
Location /bar
  Perl
$Global::SomeVar = 'bar';
  /Perl
/Location
Would certainly _not_ behave like people might expect. See what I mean ?
--

Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Perl not allowed here

2004-08-05 Thread Geoffrey Young

 out of the directory container and it will work.
 
 Philippe, has the allowed placement of Perl sections changed in mp2?

yes.

  http://marc.theaimsgroup.com/?l=apache-modperl-devm=105370080722053w=2

but I'm sure that we have talked about it since then as well.

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Perl not allowed here

2004-08-05 Thread Philippe M. Chiasson

Stas Bekman wrote:
Philippe M. Chiasson wrote:
[...]
Philippe, has the allowed placement of Perl sections changed in mp2?
For now, Perl sections are still limited to server scope. I have a patch
to open that up to OR_ALL (Location .htaccess and all) but I am not sure
of exactly what behaviour a user would expect from a Perl section in a
Location  container. For example
Location /foo
 Perl
   $Global::SomeVar = 'foo';
 /Perl
/Location
Location /bar
 Perl
   $Global::SomeVar = 'bar';
 /Perl
/Location
Would certainly _not_ behave like people might expect. See what I mean ?

True. I suppose in mp1 it was just running them all at the server 
startup, having the latest value override the previous, isn't it?
Yup!
So we should either keep it as it was in mp1, or make it DWIM. If we 
keep the mp1 behavior we ought to allow it everywhere, but document that 
it's not DWIM. How hard would it be to make it DWIM? I suppose one will 
need to stash code-refs into the dir/r struct and run them at request 
time, which won't work across threads, so the source will need to be 
stored. doesn't seem very effective to me. 
Yes, exactly! If it were a simple matter to get them to run per directory/
location, I might have tried it. It just doesn't seem like it would be worth
spending time on implementing such a feature that, really, would just be
misusing what Perl sections were for.
One is ought to use the 
PerlHeaderParserHandler to accomplish DWIM in the example above.
Yes, I was just making a bad example of what someone _might_ do.
So I think it's the most sane to keep mp1's behavior. i.e.:
- allow Perl everywhere
Yes, and like I pointed out before, they would be executed for every
requests in the .htaccess cases.
- document that it's not DWIM (i.e. everythings is run at the server 
startup)
+1
--

Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Perl not allowed here

2004-08-05 Thread Stas Bekman
Philippe M. Chiasson wrote:
Hmm, I think we ought to start with:
- PerlModule, PerlRequire, Perl in .htaccess is missing
   http://marc.theaimsgroup.com/?t=10537008871r=1w=2
   Owner: geoff

Perl sections in .htaccess would be executed on every request, so that's
quite DWIM. In other containers, like Location and others, on server 
startup
only, so not DWIM at all.
As long as this is clearly documented, I think it's fine.
--
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Perl not allowed here

2004-08-05 Thread Philippe M. Chiasson

Stas Bekman wrote:
Philippe M. Chiasson wrote:

Hmm, I think we ought to start with:
- PerlModule, PerlRequire, Perl in .htaccess is missing
  http://marc.theaimsgroup.com/?t=10537008871r=1w=2
  Owner: geoff

Perl sections in .htaccess would be executed on every request, so that's
quite DWIM. In other containers, like Location and others, on server 
startup
only, so not DWIM at all.

As long as this is clearly documented, I think it's fine.
Unless geoff takes this one, I'll take care of it by tomorrow.
--

Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Perl not allowed here

2004-08-05 Thread Geoffrey Young


Philippe M. Chiasson wrote:

 Unless geoff takes this one, I'll take care of it by tomorrow.

it's all yours :)

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html