Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: Declaring a Variable [for BEGINNERS]

by talexb (Canon)
on Dec 28, 2006 at 09:55 UTC ( #592007=note: print w/replies, xml ) Need Help??

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.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Re^2: Declaring a Variable [for BEGINNERS]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://592007]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2016-10-28 06:36 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (375 votes). Check out past polls.