Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Doug MacEachern
forget about mod_perl for a moment. yes, true, Perl's built-in require will not reload a module if it's already in %INC. but that's doesn't mean a Perl environment cannot un-cache that entry so it will be reloaded. consider the code below, pretend that loop is a long-lifetime server, Tk type

Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Doug MacEachern
On Fri, 26 May 2000, Marc Lehmann wrote: I know this and I have no problems with that (as I made very clear in my last mail). But when mod_perl requires special programming techniques this does not mean that code not using that techniques is "broken anyway", as dougm said, at least not in

Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Marc Lehmann
On Thu, Jun 01, 2000 at 11:59:53AM -0700, Doug MacEachern [EMAIL PROTECTED] wrote: will not reload a module if it's already in %INC. but that's doesn't mean a Perl environment cannot un-cache that entry so it will be reloaded. consider the code below, pretend that loop is a long-lifetime

Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Perrin Harkins
On Thu, 1 Jun 2000, Marc Lehmann wrote: It's easy, I just have to kick my ass each time I want to use a lexical for data abstraction and use a package variable instead, with only the exception that I have to be very careful that I never re-use the same name. This is quite difficult for code

Re: global variables and reparsing question (low priority ;)

2000-05-26 Thread Marc Lehmann
On Fri, May 26, 2000 at 10:33:15AM -0400, Geoffrey Young [EMAIL PROTECTED] wrote: mod_perl sometimes requires special perl coding guidelines, due in part to the way mod_perl works with and within apache. I know this and I have no problems with that (as I made very clear in my last mail). But

Re: global variables and reparsing question (low priority ;)

2000-05-26 Thread Daniel Jacobowitz
On Tue, May 23, 2000 at 10:05:01AM +0200, Marc Lehmann wrote: On Tue, May 23, 2000 at 12:56:28AM -0500, Autarch [EMAIL PROTECTED] wrote: On Tue, 23 May 2000, Marc Lehmann wrote: stable (mod_perl really is very unstable for large applications). Apart Wow, I wish you'd warned me

Re: global variables and reparsing question (low priority ;)

2000-05-25 Thread Doug MacEachern
On Wed, 24 May 2000, Marc Lehmann wrote: You must be kidding here!!! Using lexicals on package level is broken??? If it is broken, then _why_ is it recommended programming practise in perl (see perltoot for example)? i'm not kidding. i don't understand whay you mean by 'using lexicals on

Re: global variables and reparsing question (low priority ;)

2000-05-25 Thread Marc Lehmann
On Thu, May 25, 2000 at 11:58:38AM -0700, Doug MacEachern [EMAIL PROTECTED] wrote: You must be kidding here!!! Using lexicals on package level is broken??? If it is broken, then _why_ is it recommended programming practise in perl (see perltoot for example)? i'm not kidding. i don't

Re: global variables and reparsing question (low priority ;)

2000-05-24 Thread Marc Lehmann
Huh? Why is "do" a bad thing Do is bad because it is called every time, even if you've already executed You are confused about the two different forms of do. The do BLOCK form I used has nothing to do with the do EXPR form you seem to be confused about. perldoc -f do explains the

Re: global variables and reparsing question (low priority ;)

2000-05-24 Thread Marc Lehmann
On Tue, May 23, 2000 at 08:22:59PM -0700, Doug MacEachern [EMAIL PROTECTED] wrote: If this were true, it would be very bad. If there is no technical need to do this "half-reloading" then it should definitely be turned off. it is off by default, you turned it on with 'PerlFreshRestart On'

Re: global variables and reparsing question (low priority ;)

2000-05-24 Thread Ken Williams
[EMAIL PROTECTED] (Marc Lehmann) wrote: flag to keep from compiling again and checking $@ yourself, so you're getting around these problems, but the file form of do is generally a red flag. This is just as saying "division is a bad thing in general, because it let's you try to divide by

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Perrin Harkins
I don't quite understand what you're trying to do, but what you have here is a closure and it looks like you want a real global instead. (man perlref if "closure" doesn't ring a bell.) Some of your language makes it look like you may have some confusion between global and lexicals. At any

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Marc Lehmann
On Tue, May 23, 2000 at 12:56:28AM -0500, Autarch [EMAIL PROTECTED] wrote: On Tue, 23 May 2000, Marc Lehmann wrote: stable (mod_perl really is very unstable for large applications). Apart Wow, I wish you'd warned me before I did several large applications using mod_perl. Fortunately,

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Marc Lehmann
On Tue, May 23, 2000 at 12:27:58PM +0800, Gunther Birznieks [EMAIL PROTECTED] wrote: replace my $global with use vars qw($global); and your problem should disappear. If you had read my mail you would have known that I do not search for a workaround. While in this simple example it is

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Matt Sergeant
On Tue, 23 May 2000, Marc Lehmann wrote: On Tue, May 23, 2000 at 12:56:28AM -0500, Autarch [EMAIL PROTECTED] wrote: On Tue, 23 May 2000, Marc Lehmann wrote: stable (mod_perl really is very unstable for large applications). Apart Wow, I wish you'd warned me before I did several

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Marc Lehmann
On Mon, May 22, 2000 at 11:24:10PM -0700, Perrin Harkins [EMAIL PROTECTED] wrote: business about being parsed twice only applies to Apache's config file and Perl sections in it, not to your modules. A little followup: Looking at the mod_perl source, I see that INC is tinkered with in a lot of

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Marc Lehmann
On Tue, May 23, 2000 at 09:26:13AM +0100, Matt Sergeant [EMAIL PROTECTED] wrote: Hmm... AxKit does all this, and is very stable for me, and I've only had a couple of reports of segfaults, none of which went unsolved as far as I know... OK. To be fair, I am not 100% sure wether it's an

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Ken Williams
[EMAIL PROTECTED] (Marc Lehmann) wrote: = package othermodule; my $global = 5; sub set_global { $global = shift; } = And use this from

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Gustavo Duarte
helu. Marc Lehmann wrote: And so my question is: why does this behaviour exist, and why is it necessary (the documents I saw so far only told me that this "has something to do with apache's configuration file parsing", which doesn't explain much, especially as it does seem unnecessary).

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Marc Lehmann
On Tue, May 23, 2000 at 10:08:46AM -0700, Gustavo Duarte [EMAIL PROTECTED] wrote: I'm not sure this makes sense for your case, but it might help, so... It probably makes a lot of sense. Thanks! "When the server [apache] is restarted, the configuration and module initialization phases are

Re: global variables and reparsing question (low priority ;)

2000-05-23 Thread Doug MacEachern
On Tue, 23 May 2000, Marc Lehmann wrote: At leats in the example I sent in there is no sign of any closure. There is a closure, and this might be the thing that's making trouble for you, or at least part of it. This is a closure: that example is only a closure if it's compiled by

global variables and reparsing question (low priority ;)

2000-05-22 Thread Marc Lehmann
While I understand how my problem happens, it just caught me again (letting me debug another two hours), and so I wanted to ask why this peculiar behaviour is really necessary. But straight to the point. If I have a module like this:

Re: global variables and reparsing question (low priority ;)

2000-05-22 Thread Gunther Birznieks
replace my $global with use vars qw($global); and your problem should disappear. At 05:40 AM 5/23/00 +0200, Marc Lehmann wrote: While I understand how my problem happens, it just caught me again (letting me debug another two hours), and so I wanted to ask why this peculiar behaviour is really

Re: global variables and reparsing question (low priority ;)

2000-05-22 Thread Autarch
On Tue, 23 May 2000, Marc Lehmann wrote: stable (mod_perl really is very unstable for large applications). Apart Wow, I wish you'd warned me before I did several large applications using mod_perl. Fortunately, they haven't experienced any mod_perl related problems. Just a fluke, I guess.