in reply to Re: Perl Programming guidlines/rules
in thread Perl Programming guidelines/rules

Note that your approach to widely scoped lexical variables (those are not globals, by the way) could be a real problem in a persistent environment like FastCGI, PerlEx, or mod_perl. Those are closures, so if any of them didn't get set on a particular request they would retain their previous values.
  • Comment on Re: Re: Perl Programming guidlines/rules

Replies are listed 'Best First'.
Re: Re: Re: Perl Programming guidlines/rules
by hardburn (Abbot) on Nov 22, 2002 at 00:33 UTC

    . . . those are not globals, by the way . . .

    OK, fine, in Perl, there technically aren't any global vars. There is just vars that have a really wide scope. However, for practical matters, widely scoped lexicals are global vars.

      Not really. "Global variable" means something specific in Perl: a variable like $SomePackagage::Foo or just $Foo that is declared without "my". They are global because any other package can see them and change them. Lexical (my) variables are not visible outside of their current scope. It's a significant difference.