-foreach my $i (0..$#elected) {
- my $c = $elected[$i];
- printf " %3d. %-10s %s\n", $i+1, $c->{Cand}, $c->{Desc};
+if ($for_compare) {
+ foreach my $c (sort { $a->{Cand} cmp $b->{Cand} } @elected) {
+ printf " %s\n", $c->{Cand};
+ }
+} else {
+ foreach my $i (0..$#elected) {
+ my $c = $elected[$i];
+ printf " %3d. %-10s %s\n", $i+1, $c->{Cand}, $c->{Desc};
+ }