Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;

by ikegami (Patriarch)
on Aug 21, 2009 at 19:37 UTC ( [id://790450]=note: print w/replies, xml ) Need Help??


in reply to Re: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;
in thread Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;

So if your @row was the result of some operation that happened to return an empty list, $count would set to 0 rather than '';

That should be "rather than undef".

  • Comment on Re^2: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found