local $\="\n"; for $bar ( 0, 1, 2 ) { print "$bar => ", $bar > 0 ? $bar > 1 ? "male" : "female" : "robot"; } __END__ 0 => robot 1 => female 2 => male