in reply to Re: static variable hack
in thread static variable hack
{ my $static; sub func { ... } }
I'd updated that to:
BEGIN { my $static= ...; sub func { ... } }
The BEGIN allows this to work just fine under mod_perl, and protects against people calling the subroutine before the $static is initialized. The subroutine is defined when it is compiled, so it is best to initialize the $static before that.
- tye
|
---|