in reply to Re: Declaring a Variable [for BEGINNERS]
in thread Declaring a Variable [for BEGINNERS]
- The clump-o-variables (and it's sibling the clump-o-subroutines) is often the hallmark of someone who has written a lot of C or Shell, where you really had to declare before use. The Perl compiler is a little brighter than that. Constructing your code so that it assists in understanding the logic-flow is a good thing. Clumps of things that impede the understanding should be avoided.
If I can come to the defense of C, both languages permit you to declare locally scoped variables at the start of a block. Only in Perl can you declare variables mid-block, although I haven't tested that recently.
|
---|
In Section
Seekers of Perl Wisdom