Basically, if you use strict (and you should) variables declared with "my" can only be used from the declaration on until the end of the scope they're declared in:
Using "my" (lexical) variables together with "strict" will significantly reduce the risk of typos or modifying "unrelated" variables.sub mysub { my $var1 = 1; # here you can use $var1 } $var1 = "boo"; # compile error: there is no $var1 declared in this sco +pe.
In reply to Re^3: cgi session
by Joost
in thread cgi session
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |