Algorithm::Voting::Ballot - represents a ballot to cast in a race
use Algorithm::Voting::Ballot; my $ballot = Algorithm::Voting::Ballot->new('Pedro');
Or equivalently:
use Algorithm::Voting::Ballot; my $ballot = Algorithm::Voting::Ballot->new(candidate => 'Pedro');
Instances of this class contain the information specified on a ballot. Expect this class to gain complexity as more complicated voting systems (e.g. IRV, Condorcet) are implemented.
Constructs a new ballot object. Currently only suitable for indicating a single candidate, e.g. for Plurality ballots.
# vote for Pedro my $ballot = Algorithm::Voting::Ballot->new('Pedro')
Returns a scalar (presumably a string, although this is not enforced) containing the candidate for whom this ballot is cast.
To install Algorithm::Voting, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::Voting
CPAN shell
perl -MCPAN -e shell install Algorithm::Voting
For more information on module installation, please visit the detailed CPAN module installation guide.