ghosh123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monk
A table cell in my web application is showing the value based on a conditional statement. Please refer to the code below :
<td align=center> @{[ ($string eq 'level3' )? 'level3 stage' : +'Edit']}</td>
Now assume that $string may contain two more values, say for example 'level1' and 'level2' .
And each such cases the value shown in the table cell would be 'level1 stage' and 'level2 stage' respectively otherwise 'Edit'.
How would I change the above syntax to accommodate two more conditions to check the other possible values in $string and show the desired results.
thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl syntax help for ternary operator
by Corion (Patriarch) on Oct 09, 2014 at 07:47 UTC | |
Re: perl syntax help for ternary operator
by choroba (Cardinal) on Oct 09, 2014 at 07:51 UTC | |
Re: perl syntax help for ternary operator
by AnomalousMonk (Archbishop) on Oct 09, 2014 at 12:59 UTC | |
Re: perl syntax help for ternary operator
by Anonymous Monk on Oct 09, 2014 at 08:45 UTC |
Back to
Seekers of Perl Wisdom