Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Perl Style: Is initializing variables considered taboo?

by ikegami (Patriarch)
on Aug 21, 2010 at 15:45 UTC ( [id://856468]=note: print w/replies, xml ) Need Help??


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

Some people like to differentiate "doesn't have a value yet"

my $x;

from "has the value undef (or false)

my $x = undef; my $x = 0;

Perl, of course, doesn't case. It's stylistic semantics.

Now, if you do the following, it's a bit silly:

my $x = undef; if (cond()) { $x = f(); } else { $x = g(); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-19 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found