summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Games/Word/Wordlist.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Games/Word/Wordlist.pm b/lib/Games/Word/Wordlist.pm
index 59e35e0..87bb7d6 100644
--- a/lib/Games/Word/Wordlist.pm
+++ b/lib/Games/Word/Wordlist.pm
@@ -131,6 +131,9 @@ 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};
+
delete $self->{word_hash}{$_} for (@_);
$self->{word_list} = [keys %{$self->{word_hash}}];
}