in reply to Re: How to initialize all variables
in thread How to initialize all variables
I think you're being unreasonably insistent. Perl makes certain guarantees re initialization and I don't see a problem with relying on that. To my eye, explicit initialization often clutters more than it clarifies. For example, I prefer:
to the explicitly initialized:my $fred; # $fred contains undef my @jock; # @jock is empty
Similarly, ANSI C guarantees that global/static variables are initialized to zero and I often take advantage of that by omitting explicit initialization, especially when initializing arrays (as I did, for example, in Re: Rosetta PGA-TRAM).my $fred = undef; my @jock = ();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to initialize all variables
by Anonymous Monk on Sep 12, 2010 at 02:54 UTC | |
by eyepopslikeamosquito (Archbishop) on Sep 12, 2010 at 05:02 UTC | |
by Anonymous Monk on Sep 13, 2010 at 01:24 UTC | |
by Jenda (Abbot) on Sep 12, 2010 at 17:49 UTC |