kdmurphy001 has asked for the wisdom of the Perl Monks concerning the following question:
Most of it is straight forward but the ? $row[0] : 0; throws me off. I don't know what the "?" and ":" are doing. $row[0] refer to a database pull and will be a value no smaller then 1 (1 to something large). Thank you so much! Going through someone elses scripts can be a bit daunting at times.my $count = $row[0] ? $row[0] : 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;
by SuicideJunkie (Vicar) on Aug 21, 2009 at 18:42 UTC | |
|
Re: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;
by ikegami (Patriarch) on Aug 21, 2009 at 18:44 UTC | |
by Tanktalus (Canon) on Aug 21, 2009 at 18:50 UTC | |
by ikegami (Patriarch) on Aug 21, 2009 at 18:57 UTC | |
by kdmurphy001 (Sexton) on Aug 21, 2009 at 18:59 UTC | |
|
Re: Help understanding a single line of perl: my $count = $row[0] ? $row[0] : 0;
by ramlight (Friar) on Aug 21, 2009 at 18:54 UTC | |
by ikegami (Patriarch) on Aug 21, 2009 at 19:37 UTC |