diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-02-02 00:04:40 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-02-02 00:04:40 -0500 |
commit | 69f8d7813a20f41568a6eec0503f04dce2e81613 (patch) | |
tree | ff68877fc13d7cd77b9b0cbea691002e2da287e4 /lib | |
parent | ac7fd1b400c0a4d11047f80fd151c5df84c9d1a9 (diff) | |
download | games-word-69f8d7813a20f41568a6eec0503f04dce2e81613.tar.gz games-word-69f8d7813a20f41568a6eec0503f04dce2e81613.zip |
make $wl->words work properly when the wordlist isn't cached
Diffstat (limited to 'lib')
-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 { |