Re: <Perl>...</Perl> and startup.pl equivalent?

[prev] [thread] [next] [Date index for 2004/12/14]

From: Philippe M. Chiasson
Subject: Re: <Perl>...</Perl> and startup.pl equivalent?
Date: 21:12 on 14 Dec 2004
--------------enig3CAF3674ABF5278038AE8EAC
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Stas Bekman wrote:
> colin_e wrote:
> 
>>Cool. To my (naiive i'm sure) eye this looks just like the behaviour of 
>>a brace-delimited
>>block in a chunk of mainline code, which is what I was hoping/expecting.
> 
> 
> (I guess you are talking about lexicaly scoped vars) plus that any globals 
> which in a normal script:
> 
> $foo = 5;
> 
> will end up in main:
> 
> $main::foo
> 
> will be nuked as well.

Well, keep in mind that <Perl> directives are now processed in a very
similar way other 'phases' are dealt with, so internally, each <perl>
block get's it's own package name. That's what gets wiped after the
<perl> block is finished being evaluated. So if you stick something
in a explicit package name, like $main::foo = 1, that will remain.

> 
>>Some examples of good/bad/dangerous things to do in these <Perl></Perl> 
>>sections
>>would be very helpful though. I can imagine for instance that mucking 
>>around with
>>package declarations inside one could make life complicated.
> 
> It's more simple than that. don't use <Perl></Perl> sections for anything 
> that you can do from real perl.  <Perl></Perl> sections are there only for 
> doing Apache configuration. Anything else, you are on your own. so any 
> example that doesn't deal with Apache config is a bad example.

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

--------------enig3CAF3674ABF5278038AE8EAC
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBv1ciyzKhB4jDpaURAiuNAJ9KqEck3b4w88/ScvCxkzn0CN7LNwCgkgnv
e84Y7Rar21nhYnqtgTqelbo=
=Mn0q
-----END PGP SIGNATURE-----

--------------enig3CAF3674ABF5278038AE8EAC--

(message missing)

Re: <Perl>...</Perl> and startup.pl equivalent?
Martin Moss 14:51 on 13 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 23:41 on 13 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 23:53 on 13 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 00:29 on 14 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 16:54 on 13 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 23:31 on 13 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Philippe M. Chiasson 23:42 on 13 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 00:27 on 14 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Philippe M. Chiasson 21:12 on 14 Dec 2004

Re: <Perl>...</Perl> and startup.pl equivalent?
Stas Bekman 23:53 on 14 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52