in reply to Intialization
It will, however, generate warnings if you have warnings enabled if you attempt to use a new scalar in its undefined state as if it were defined (such as in math, or in string concatenation). Generally it's safer to initialize the variable when you declare it, unless you plan on explicitely assigning a value to it later. At the very minimum it helps you track down bugs in your code if you're 100% certain about the starting state of a variable.
my $i = 0; my $str = ""; my $var; ... $var = 10;
|
|---|