From 36be13d5149e8b6180a7aa7693106795414ee3e2 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Sat, 2 Feb 2008 18:44:28 -0500 Subject: die on remove_words if we aren't using a cache (like we already do with add_words) --- lib/Games/Word/Wordlist.pm | 3 +++ 1 file changed, 3 insertions(+) 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}}]; } -- cgit v1.2.3-54-g00ecf