Re: localized lexical varibles

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 22:27 +0300, Vladimir D Belousov wrote: > As I know, my module has been loaded only once and has been loaded by > the root httpd process. > And when any httpd forks exist (prefork), let's present next situation: > one of the existing httpd forks changes value of any variable

Re: localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Michael Peters wrote: Vladimir D Belousov wrote: Tom Schindl wrote: Vladimir D Belousov wrote: [skipped] The variables would get reinitialized if you passed them in as arguments. The link that I sent you explains that once the Call sub is compiled it creates a closure around the $r and $s varia

Re: localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Michael Peters wrote: Vladimir D Belousov wrote: [skipped] You're creating a closure with $s and $r. Check out http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Understanding_Closuresthe_Easy_Way to understand why this causes strange behavior. Thank you! I searched for

Re: localized lexical varibles

2005-03-15 Thread Michael Peters
Vladimir D Belousov wrote: Tom Schindl wrote: Vladimir D Belousov wrote: You are creating a closure here for $s here. There enough material out there go and read about closures(See Apache::Registry). Why do you embed a sub into a sub? I hope this sub will be mmm... "localized subroutine" and al

Re: localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Tom Schindl wrote: Vladimir D Belousov wrote: [skipped] You are creating a closure here for $s here. There enough material out there go and read about closures(See Apache::Registry). Why do you embed a sub into a sub? I hope this sub will be mmm... "localized subroutine" and all varibles in one

Re: localized lexical varibles

2005-03-15 Thread Tom Schindl
Vladimir D Belousov wrote: Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':com

Re: localized lexical varibles

2005-03-15 Thread Michael Peters
Vladimir D Belousov wrote: Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':com

localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':common'; sub handler { my $