Game::WordBrain::Word - Representation of a Word for WordBrain
# Create a new word my @letters = ( Game::WordBrain::Letter->new( ... ), Game::WordBrain::Letter->new( ... ), ...; ); my $word = Game::WordBrain::Word->new( letters => \@letters ); # Stringify print $word; # Overloaded Stringification print $word->word; # Explict stringification
A Game::WordBrain::Word is composed of an ArrayRef of Game::WordBrain::Letters that are used to construct it.
An ArrayRefof Game::WordBrain::Letters that comprise the word.
my @letters = ( Game::WordBrain::Letter->new( ... ), Game::WordBrain::Letter->new( ... ), ...; ); my $word = Game::WordBrain::Word->new( letters => \@letters );
Given an ArrayRef of Game::WordBrain::Letters, create a new potential WordBrain word.
my $word = Game::WordBrain::Word->new( ... ); print $word->word;
Explict stringification of the word. There is also overloaded " stringification but you are free to use which ever method you are most comfortable with.
To install Game::WordBrain, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Game::WordBrain
CPAN shell
perl -MCPAN -e shell install Game::WordBrain
For more information on module installation, please visit the detailed CPAN module installation guide.