in reply to Re: Private Variables and FastCGI / ModPerl
in thread Private Variables and FastCGI / ModPerl

Using local $var seems to be the fix for such problems. Although it may/may not work with mod_perl, it seems to work fine within the FCGI loop.
use FCGI; while (FCGI::accept >= 0) { local $cnt; local $last_elapsed; ############### &http(0); &head(); &t(''); print "OK"; &t(''); &t(''); my $cc; while ($cc < 1000){ &test; $cc++; } } sub test(){ print "CNT: $cnt"; $cnt++; }