Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://856483]
help
Chatterbox?
Corion attempts to find who to address to better target his drive-by patches
[Corion]: This time it's for the Duktape embedded Javascript engine, which would be nice to have IMO, but doesn't compile on Windows currently
[Corion]: I imagine it would be fun to have WWW::Mechanize:: Duktape, but I haven't seen a web browser written in Javascript yet, except the ones distributed with PhantomJs

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-03-27 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (319 votes). Check out past polls.