if (not defined $params{tally_fh}) {
$params{tally_fh} = \*STDIN;
}
+ # header been output?
+ my $header_output = 0;
# This is where we get our input data from
while (defined ($_ = $params{tally_fh}->getline)) {
for my $opt (@options) {
$vote .= exists $option_rank{$opt->{key}} ? $number_to_option{$option_rank{$opt->{key}}} : '-';
}
+ if (not $header_output) {
+ print {$RESULTS} "/--".join("",map {$_->{key}} @options)."\n";
+ $header_output = 1;
+ }
print {$RESULTS} "V: $vote $voter\n";
} else {
printf {$RESULTS} "Option %s ", $order_to_options{$row + 1}{key};
for my $col (0..($max_choices - 1)) {
if ($row == $col) {
- printf {$RESULTS} " ", $Beat_Matrix[$row][$col];
+ print {$RESULTS} " ";
} else {
printf {$RESULTS} " % 4d ", $Beat_Matrix[$row][$col];
}