|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
Re: Perl Style: Is initializing variables considered taboo?by rowdog (Curate) |
| on Aug 21, 2010 at 17:05 UTC ( [id://856483]=note: print w/replies, xml ) | Need Help?? |
|
I cut my teeth on C so I suppose that's why I never assume any variable has a value until I give it one.
my $var = undef; means that I plan to use $var and I care that the value is undef.
my $var; means I plan to set the value later. Usually, I'm just declaring $var in an outer scope and this shows that.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||