On Mon, 2004-09-20 at 06:41, Arnaud Blancher wrote:
> i see the potential problem of mod perl but it's not a really good solution
> to change the script every times i want to test !

Perl is not going to warn you about this because it is actually legal to
do it this way in perl.  There's no way for Perl to know that you didn't
intend for the variables you put in the closure to keep their values
between requests.

The best thing to do is to always pass all variables (except constants)
to all of your subs, or switch to an object-oriented coding approach. 
The kind of coding where you just use variables that are in scope from a
subroutine without passing them explicitly to the sub is a bad practice
because it means your subroutines are "tightly coupled" to the
surrounding code and it makes it difficult to move them into modules or
to debug them.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to