summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Games/Word/Wordlist.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Games/Word/Wordlist.pm b/lib/Games/Word/Wordlist.pm
index ab1b752..d242757 100644
--- a/lib/Games/Word/Wordlist.pm
+++ b/lib/Games/Word/Wordlist.pm
@@ -106,8 +106,7 @@ sub add_words {
my $self = shift;
my $word_list = shift;
- die "Can't add words to a non-cached word list"
- unless $self->{cache};
+ die "Can't add words to a non-cached word list" unless $self->{cache};
if (ref($word_list) eq 'ARRAY') {
$self->{word_hash}{$_} = 1 for @$word_list;
@@ -132,8 +131,7 @@ Takes a list of words to remove (ignoring words that aren't in the word list).
sub remove_words {
my $self = shift;
- die "Can't remove words from a non-cached word list"
- unless $self->{cache};
+ die "Can't remove words from a non-cached word list" unless $self->{cache};
delete $self->{word_hash}{$_} for (@_);
$self->{word_list} = [keys %{$self->{word_hash}}];
@@ -153,6 +151,7 @@ sub words {
return @{$self->{word_list}} if $self->{cache};
open my $fh, '<', $self->{file} or die "Opening $self->{file} failed";
for (<$fh>) {}
+
return $.;
}