Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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.


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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2023-04-01 18:05 GMT
Find Nodes?
    Voting Booth?

    No recent polls found