From aba72b1e077645882b4bbcafab8fb5c969e2613a Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Thu, 18 Dec 2008 05:00:55 -0500 Subject: test for $string being empty, not just $substring --- lib/Games/Word.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Games/Word.pm b/lib/Games/Word.pm index 43aaae7..f721afb 100644 --- a/lib/Games/Word.pm +++ b/lib/Games/Word.pm @@ -196,6 +196,7 @@ sub is_substring { my ($substring, $string) = @_; return 1 if $substring eq ''; + return 0 if $string eq ''; my $re = join('?', map { quotemeta } split(//, $string)) . '?'; return $substring =~ $re; } -- cgit v1.2.3