(exists $hash{$_} and $hash{$_} eq 'on') ? $result = 'OK' : $result = 'KO' #### ( cond ? $result = 'OK' : $result) = 'KO' #### ($result = 'OK') = 'KO'