Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Perl Programming guidlines/rules

by perrin (Chancellor)
on Nov 21, 2002 at 17:24 UTC ( [id://214826]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://214826]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-25 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found