Unless scoped by my() or local(), perl variables in mod_perl are treated as globals, and values set may persist from one request to another. This can be seen in as simple a script as this:
<HTML><BODY>
$counter++;
$Response->Write("<BR>Counter: $counter");
</BODY></HTML>
The value for $counter++ will remain between requests. Generally use of globals in this way is a BAD IDEA, and you can spare yourself many headaches if do "use strict" perl programming which forces you to explicity declare globals like:
use vars qw($counter);
You can make all your Apache::ASP scripts strict by default by setting:
PerlSetVar UseStrict 1
Answered by
Nagendra
, an ibibo Master,
at
5:17 AM on December 04, 2008