Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: mod_perl children process

by CountZero (Bishop)
on Oct 08, 2017 at 11:44 UTC ( [id://1200942]=note: print w/replies, xml ) Need Help??


in reply to mod_perl children process

You have seen for yourself how confusing it is to use global variables in a mod_perl script. You never can predict *which* instance of that global variable will be used.

It is a good practice to only use lexical "my" variables or if you must use global variables, explicitly initialize them to a known value.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: mod_perl children process
by KurtZ (Friar) on Oct 08, 2017 at 13:34 UTC
    Why is a my variable in file scope any better?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-03-28 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found