in reply to Re^3: Variable will not stay shared in a sporadically crashing CGI
in thread Variable will not stay shared in a sporadically crashing CGI

This is getting a bit off-topic, but some globals are ok. Novice programmers don't always know when they're safe and when they aren't, and they're often too timid to change a global to a local when it really needs to be done. That's why we advise people not to use globals at all. But CGI is probably safe as a global, because there's no reason to have two of them in your program.
  • Comment on Re^4: Variable will not stay shared in a sporadically crashing CGI

Replies are listed 'Best First'.
Re^5: Variable will not stay shared in a sporadically crashing CGI
by haukex (Archbishop) on Oct 02, 2017 at 13:53 UTC
    But CGI is probably safe as a global, because there's no reason to have two of them in your program.

    I absolutely agree with the general comment about some globals being ok if the coder knows what they are doing - but we are talking about mod_perl here, better to play it safe, and lexicals are arguably safer* in this case.

    * Update: "safer" not in the sense of security, but in less chances for things to go wrong.