From c06e22eea1c54aa90d93f705b58ed5887d9fffd6 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Thu, 18 Dec 2008 05:02:47 -0500 Subject: anchor this regex, so it stops just matching everything --- lib/Games/Word.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Games/Word.pm b/lib/Games/Word.pm index f721afb..f875c67 100644 --- a/lib/Games/Word.pm +++ b/lib/Games/Word.pm @@ -198,7 +198,7 @@ sub is_substring { return 1 if $substring eq ''; return 0 if $string eq ''; my $re = join('?', map { quotemeta } split(//, $string)) . '?'; - return $substring =~ $re; + return $substring =~ /^$re$/; } =item all_substrings STRING -- cgit v1.2.3