http://qs321.pair.com?node_id=1200942


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?