Re: global variables and reparsing (short reproducible example)

2000-11-25 Thread Stas Bekman
On 24 May 2000, Randal L. Schwartz wrote: "tayers" == [EMAIL PROTECTED] writes: tayers Given the above more complete descriptions I would say the usage in tayers Lperlsub is confusing. I agree with that, and with your general observation. From my hanging out on P5P, a subroutine is

Re: global variables and reparsing (short reproducible example)

2000-06-01 Thread Doug MacEachern
On Fri, 26 May 2000, Marc Lehmann wrote: On Thu, May 25, 2000 at 12:09:09PM -0700, Doug MacEachern [EMAIL PROTECTED] wrote: You can only configure Apache from Perl sections, but you can load all your modules, shared data, etc. from a file pulled in with PerlRequire. actually you can,

Re: global variables and reparsing (short reproducible example)

2000-05-25 Thread Doug MacEachern
On Wed, 24 May 2000, Perrin Harkins wrote: On Wed, 24 May 2000, Marc Lehmann wrote: I was under the impression that you cannot configure Apache from a PerlRequire. If that is not the case (and somehow works) I'd really like to get away from perlsections. You can only configure Apache

Re: global variables and reparsing (short reproducible example)

2000-05-25 Thread Marc Lehmann
On Thu, May 25, 2000 at 12:09:09PM -0700, Doug MacEachern [EMAIL PROTECTED] wrote: You can only configure Apache from Perl sections, but you can load all your modules, shared data, etc. from a file pulled in with PerlRequire. actually you can, if a module defines variables in the

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Marc Lehmann
On Tue, May 23, 2000 at 04:07:40PM -0700, Perrin Harkins [EMAIL PROTECTED] wrote: This is a combination of closures and PerlFreshRestart biting (still no closures) My example might be misleading, since I used x before it was defined (to make the example short). Typical examples look like this:

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Marc Lehmann
On Wed, May 24, 2000 at 12:52:37AM +0300, Stas Bekman [EMAIL PROTECTED] wrote: You can control what's being reloaded and what's not: http://perl.apache.org/guide/config.html#Apache_Restarts_Twice_On_Start

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Marc Lehmann
On Tue, 23 May 2000, Perrin Harkins wrote: Your sub x is a closure. That's why it returns the previous value of No. In perl, a closure is *defined* as "anonymous subroutine" (see the documentation). If you define it different, you are right, but you are not talking about perl then. --

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Randal L. Schwartz
"tayers" == [EMAIL PROTECTED] writes: tayers Given the above more complete descriptions I would say the usage in tayers Lperlsub is confusing. I agree with that, and with your general observation. From my hanging out on P5P, a subroutine is only a closure when it sees lexical variables and

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Perrin Harkins
On Wed, 24 May 2000, Marc Lehmann wrote: On Wed, May 24, 2000 at 12:52:37AM +0300, Stas Bekman [EMAIL PROTECTED] wrote: You can control what's being reloaded and what's not: http://perl.apache.org/guide/config.html#Apache_Restarts_Twice_On_Start

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Perrin Harkins
On Wed, 24 May 2000, Marc Lehmann wrote: I was under the impression that you cannot configure Apache from a PerlRequire. If that is not the case (and somehow works) I'd really like to get away from perlsections. You can only configure Apache from Perl sections, but you can load all your

Re: global variables and reparsing (short reproducible example)

2000-05-24 Thread Marc Lehmann
On Wed, May 24, 2000 at 11:30:40AM -0700, Perrin Harkins [EMAIL PROTECTED] wrote: example did something similar, indeed, but it had to be embedded into the module source, which is somewhat inconvinient. If you don't have PerlFreshRestart turned on (it is not recommended on production

global variables and reparsing (short reproducible example)

2000-05-23 Thread Marc Lehmann
On Tue, May 23, 2000 at 07:15:46AM -0500, Ken Williams [EMAIL PROTECTED] wrote: my $global = 5; sub set_global { $global = shift; } othermodule::set_global 7; = Then, to my surprise, _sometimes_ the $global

Re: global variables and reparsing (short reproducible example)

2000-05-23 Thread Doug MacEachern
On Tue, 23 May 2000, Marc Lehmann wrote: As a related note, I wondered why there isn't a mod_perl callback that is clled _before_ forking, but after configuration parsing. This would allow a lot of data sharing between the httpd servers. My module requires you to call "configured PApp" at

Re: global variables and reparsing (short reproducible example)

2000-05-23 Thread Marc Lehmann
On Tue, May 23, 2000 at 11:53:04AM -0700, Doug MacEachern [EMAIL PROTECTED] wrote: a lot of data sharing between the httpd servers. My module requires you to call "configured PApp" at the end of the configuration section so that it can pull in most of the code and big data structures before

Re: global variables and reparsing (short reproducible example)

2000-05-23 Thread Doug MacEachern
On Tue, 23 May 2000, Perrin Harkins wrote: Your sub x is a closure. That's why it returns the previous value of $x. When it gets re-defined, it should start looking at the value of the new $x. nevermind what i said in the other reply about not being a closure. you're right, it is by