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