Apache resp. mod_perl is wrapping your CGI script in a subroutine to repeatedly call it. This also explains why you have the problem with the "global" lexical $cgi.
Your workaround of explicitly passing around the variable is a good one in my opinion.
In reply to Re: Variable will not stay shared in a sporadically crashing CGI
by Corion
in thread Variable will not stay shared in a sporadically crashing CGI
by Locutus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |