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;
Well, it's probably closer to:
but that's less readable to the uninitiated than what you have. :-Pmy $count = do { if ($row[0]) { $row[0]; } else { 0 } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;
by ikegami (Patriarch) on Aug 21, 2009 at 18:57 UTC |