if ($subkey == 1) { $acc = $messagebin{$file}{$subkey}; if($debug){&writelog(3,"DEBUG: Account=$acc");} } elsif ($subkey == 11) { $ordid = $messagebin{$file}{$subkey}; if($debug){&writelog(3,"DEBUG: OrderId=$ordid"); } elsif ($subkey == 14) { ... } else { # you should _always_ have an else branch warn "Unhandled subkey value $subkey."; };