- or download this
$a=1;$b=2;$c=3;$d=4;$f=5;$g=6;$h=7;
$foo = $a? $b? $c : $d? $e : $f : $g : $h;
...
__END__
syntax error at C:\temp\ternary.pl line 2, near "$g :"
Execution of C:\temp\ternary.pl aborted due to compilation errors.
- or download this
$foo = $a ? $b ? $c : $d ? $e : $f : $g;
- or download this
$foo = !$a ? $g : $b ? $c : $d ? $e : $f;
- or download this
$foo = !$a ? $g
: $b ? $c
: $d ? $e
: $f;
- or download this
$foo = $a ? ($b ? $c
: ($d ? $e
: $f))
: $g;