in reply to To initialise or not to initialise?
I have found there is a difference between:my $ctr = 0; for ( 0 .. 5 ) { if ($foo[$_] eq $bar) { $ctr++; } }
andmy $variable;
ormy $variable = "";
depending on usage. In summary, I don't think there can be a hard a fast rule. Like many things, it depends on context and the readibility you need.my $variable = 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: To initialise or not to initialise?
by kiat (Vicar) on Jun 24, 2004 at 13:30 UTC | |
by bradcathey (Prior) on Jun 24, 2004 at 13:34 UTC | |
by kiat (Vicar) on Jun 24, 2004 at 13:52 UTC |