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