Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: mod_perl children process

by CountZero (Bishop)
on Oct 08, 2017 at 11:44 UTC ( #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
Node Status?
node history
Node Type: note [id://1200942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-09-20 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (121 votes). Check out past polls.

    Notices?