Good stuff. Thanks for such a quick and helpful reply Stas.

The piece in the docs that had me confused was in the document
"Apache::PerlSections - Default Handler for Perl sections"
(http://perl.apache.org/docs/2.0/api/Apache/PerlSections.html#C__Apache__PerlSections__Save_).

This says:

> By default, the namespace in which |<Perl >| sections are evaluated is cleared
> after each block closes. By setting it to a true value, the content of those
> namespaces will be preserved and will be available for inspection by modules
> like |Apache::Status <http://perl.apache.org/docs/2.0/api/Apache/Status.html>|.


My grasp of perl is limited, "clearing a namespace" sounds to me like something goes
away. At this point i'm not entirely clear what, but i'm glad I have an answer to work
with.


Thanks.: Colin

Stas Bekman wrote:

colin_e wrote:

Platforms: Solaris 9, Win XP
Apache: 2.0.52
Perl: ActiveState Perl 5.8.4

Hi Guys,
New to Apache 2.0.52 and modperl, working through the install and configure steps.


Most books and docs on using modperl recommend using a "startup.pl" script
to configure the Perl environment on startup, setting lib paths etc. However, Apache now
supports <Perl>...</Perl> sections directly in the Apache config files.


In a normal perl script, a chunk of code brought in with "require" is exactly the same as a
block inline within the the main routine.


Queastion- is this the same in Apache? I.e, instead of using a startup.pl file can I include all the perl
configuration inline in httpd.conf inside <Perl></Perl> blocks, with the same effect? Logically
it would seem so, but the apache docs also say variables in the <Perl> blocks go away after use,
so it's unclear whether oeprations like "use lib ...." would have an effect.


Nothing run in <perl> sections goes away, please point us to the specific doc you are talking about, so we can better address this confusion.

We are going to write the best-practices for running code at startup soonish (which will include a suggestion not to use <Perl> section for anything but Config-related things). We will also add some directives (should appear in mp2-RC2). I will post to the list a notice when the information/code is ready.

Meanwhile you should be just fine running any code from <Perl> sections. If you have a specific problem please ask.




--
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



Reply via email to