diff options
Diffstat (limited to 'lib/Games/Word/Wordlist.pm')
-rw-r--r-- | lib/Games/Word/Wordlist.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Games/Word/Wordlist.pm b/lib/Games/Word/Wordlist.pm index 702f5a1..81f8a5b 100644 --- a/lib/Games/Word/Wordlist.pm +++ b/lib/Games/Word/Wordlist.pm @@ -67,8 +67,10 @@ sub remove_words { sub words { my $self = shift; - return unless $self->{cache}; - return @{$self->{word_list}}; + return @{$self->{word_list}} if $self->{cache}; + open my $fh, '<', $self->{file}; + for (<$fh>) {} + return $.; } sub _random_word_cache { |