Re: Package Lexicals and PerlModule

2000-08-04 Thread darren chamberlain
mgraham ([EMAIL PROTECTED]) said something to this effect: With the above I expect to be able to call the following in some handler: Foo::load_var() ...and $PACKAGE_LEXICAL should still be 'wubba'. ...Except that by calling Foo:load_var() you are setting $PACKAGE_LEXICAL to undef (by

RE: Package Lexicals and PerlModule

2000-08-04 Thread mgraham
darren chamberlain wrote: ...Except that by calling Foo:load_var() you are setting $PACKAGE_LEXICAL to undef (by passing in an empty list via ()), rather than retrieving it. Well, actually, I was checking to see if it was set first: sub load_var { my $param = shift;

Re: Package Lexicals and PerlModule

2000-08-04 Thread Perrin Harkins
On Fri, 4 Aug 2000, darren chamberlain wrote: Sharing a variable among children is difficult; you need to use IPC::Sharable or something similar. Not if it's read-only after the fork, which this one appears to be. You can load it with a value at startup and it will be shared. - Perrin

Re: Package Lexicals and PerlModule

2000-08-04 Thread Perrin Harkins
On Sun, 30 Jul 2000, mgraham wrote: Under mod_perl, I find inconsistent behaviour. It works fine when a module is loaded via the PerlModule directive in httpd.conf. However when a module is loaded via startup.pl, the package lexicals "forget" their values between calls. [...] The strange

RE: Package Lexicals and PerlModule

2000-08-04 Thread mgraham
Perrin Harkins wrote: This sounds like a bad interaction with PerlFreshRestart and closure variables. Does it work if you turn off PerlFreshRestart? Can you live with that? Yes! It works with PerlFreshRestart Off. I think you're right - it probably has something to do with the timing

RE: Package Lexicals and PerlModule

2000-08-04 Thread Perrin Harkins
On Fri, 4 Aug 2000, mgraham wrote: Why should PerlFreshRestart be on, anyway? Ostensibly, it's so you can make sure that your modules can survive a soft restart, but can't you also gather that from 'apachectl graceful'? With PerlFreshRestart turned off, a graceful restart will not reload

RE: Package Lexicals and PerlModule

2000-08-04 Thread Vivek Khera
"PH" == Perrin Harkins [EMAIL PROTECTED] writes: PH On Fri, 4 Aug 2000, mgraham wrote: Why should PerlFreshRestart be on, anyway? Ostensibly, it's so you can make sure that your modules can survive a soft restart, but can't you also gather that from 'apachectl graceful'? PH With

Package Lexicals and PerlModule

2000-08-03 Thread mgraham
I'm experiencing a strange variable scope issue. Normally, I expect that lexical 'my' vars declared at the package scope (i.e. at the top of a file), should be visible to subroutines declared in the same package, and should maintain their values between calls to those subroutines. Under

Re: Package Lexicals and PerlModule

2000-08-03 Thread Philip Mak
On Sun, 30 Jul 2000, mgraham wrote: Normally, I expect that lexical 'my' vars declared at the package scope (i.e. at the top of a file), should be visible to subroutines declared in the same package, and should maintain their values between calls to those subroutines. If you are running