summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-02-02 19:12:48 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-02-02 19:12:48 -0500
commitb43f516ca28514811819219fa0295bc4c9fafdc2 (patch)
tree982f25fbb3381e1a36af65b2f5a25af391b3de6d
parent809cd5446a5cccac0f29c1d269e3f28640f7176f (diff)
downloadgames-word-b43f516ca28514811819219fa0295bc4c9fafdc2.tar.gz
games-word-b43f516ca28514811819219fa0295bc4c9fafdc2.zip
a few minor cleanups
-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 $.;
}