Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl Style: Is initializing variables considered taboo?

by rowdog (Curate)
on Aug 21, 2010 at 17:05 UTC ( #856483=note: print w/ replies, xml ) Need Help??


in reply to Perl Style: Is initializing variables considered taboo?

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.


Comment on Re: Perl Style: Is initializing variables considered taboo?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2015-07-28 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls