Caveats to using Perl Sections for server configuration?

Caveats to using Perl Sections for server configuration?

am 13.01.2010 21:22:29 von Boysenberry Payne

I'm using blocks in my apache conf files for early server =
configuration.
I remember reading someone on this list saying they wouldn't use Perl =
Sections at all.
The main reason I chose to use them to initialize some of my server =
configuration was to allow for relative addressing to the .conf file =
rather than the apache root via the __FILE__ variable.
That allows me to load my perl startup.pl files on different servers =
regardless of where they're stored by keeping them arranged relative to =
the .conf file loading them.

Up to now I've kept what I've done in the Perl Sections limited to =
manipulating @INC and @PerlConfig.
I tried using a couple of perl modules that used 'our' type scopes and =
they all bombed out saying Perl Sections couldn't add the variable, e.g. =
it chokes on File::chdir's $CWD variable.
It does seem to use packages correctly, that in turn become available =
afterword in the symbol tables.

So while the documentation for the Perl Sections was adequate enough to =
get what I needed accomplished, it's left me hungry for more info on =
what's going on behind the scenes.

Before I go and dig around in the source (which I plan on doing,) I was =
wondering if anyone mind sharing the experience and insights on Perl =
Sections, pros cons, etc.

i.e. I'm referring to blocks in apache .conf files.

Thank you,
Boysenberry Payne

Re: Caveats to using Perl Sections for server configuration?

am 13.01.2010 22:15:05 von Perrin Harkins

On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
wrote:
> I'm using blocks in my apache conf files for early server configuration.
> I remember reading someone on this list saying they wouldn't use Perl Sections at all.

That might have been me. I don't like to use them. I find it simpler
to put all the perl code in a startup.pl. I also like to generate my
httpd.conf from templates, and this means I can also generate conf
files for non-mod_perl servers, like my proxy.

- Perrin

Re: Caveats to using Perl Sections for server configuration?

am 14.01.2010 02:59:18 von Boysenberry Payne

Do you know if the scope of Perl Sections are the same as when using a =
startup.pl?

-bop

On Jan 13, 2010, at 2:15 PM, Perrin Harkins wrote:

> On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
> wrote:
>> I'm using blocks in my apache conf files for early server =
configuration.
>> I remember reading someone on this list saying they wouldn't use Perl =
Sections at all.
>=20
> That might have been me. I don't like to use them. I find it simpler
> to put all the perl code in a startup.pl. I also like to generate my
> httpd.conf from templates, and this means I can also generate conf
> files for non-mod_perl servers, like my proxy.
>=20
> - Perrin

Re: Caveats to using Perl Sections for server configuration?

am 14.01.2010 22:44:06 von Perrin Harkins

I don't use them, but in a startup.pl you would be in a different package.

- Perrin

On Wed, Jan 13, 2010 at 8:59 PM, Boysenberry Payne
wrote:
> Do you know if the scope of Perl Sections are the same as when using a st=
artup.pl?
>
> -bop
>
> On Jan 13, 2010, at 2:15 PM, Perrin Harkins wrote:
>
>> On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
>> wrote:
>>> I'm using blocks in my apache conf files for early server config=
uration.
>>> I remember reading someone on this list saying they wouldn't use Perl S=
ections at all.
>>
>> That might have been me. =A0I don't like to use them. =A0I find it simpl=
er
>> to put all the perl code in a startup.pl. =A0I also like to generate my
>> httpd.conf from templates, and this means I can also generate conf
>> files for non-mod_perl servers, like my proxy.
>>
>> - Perrin
>
>

Re: Caveats to using Perl Sections for server configuration?

am 15.01.2010 09:09:25 von Issac Goldstand

FWIW, you can look at the source of Apache::UploadMeter to see an
example of sections in use - they're actually called during the
httpd.conf parsing triggered by statements found in the httpd.conf

Issac

Perrin Harkins wrote:
> I don't use them, but in a startup.pl you would be in a different package.
>
> - Perrin
>
> On Wed, Jan 13, 2010 at 8:59 PM, Boysenberry Payne
> wrote:
>
>> Do you know if the scope of Perl Sections are the same as when using a startup.pl?
>>
>> -bop
>>
>> On Jan 13, 2010, at 2:15 PM, Perrin Harkins wrote:
>>
>>
>>> On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
>>> wrote:
>>>
>>>> I'm using blocks in my apache conf files for early server configuration.
>>>> I remember reading someone on this list saying they wouldn't use Perl Sections at all.
>>>>
>>> That might have been me. I don't like to use them. I find it simpler
>>> to put all the perl code in a startup.pl. I also like to generate my
>>> httpd.conf from templates, and this means I can also generate conf
>>> files for non-mod_perl servers, like my proxy.
>>>
>>> - Perrin
>>>
>>