From c25bb1bd704d55b25d8009968d29a82ca3a45d72 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Sat, 2 Feb 2008 05:42:33 -0500 Subject: make sure we don't catch 0 here --- lib/Games/Word.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Games') diff --git a/lib/Games/Word.pm b/lib/Games/Word.pm index 46129a7..e51d865 100644 --- a/lib/Games/Word.pm +++ b/lib/Games/Word.pm @@ -16,7 +16,7 @@ use Test::Deep::NoTest; sub random_permutation { my $word = shift; - return '' unless $word; + return '' if $word eq ''; my $letter = substr $word, int(rand length $word), 1, ''; @@ -115,7 +115,7 @@ sub random_string_from { sub is_substring { my ($substring, $string) = @_; - return 1 unless $substring; + return 1 if $substring eq ''; my $re = join('?', map { quotemeta } split(//, $string)) . '?'; return $substring =~ $re; } @@ -123,7 +123,7 @@ sub is_substring { sub all_substrings { my $string = shift; - return ('') unless $string; + return ('') if $string eq ''; my @substrings = ($string); my $before = ''; -- cgit v1.2.3-54-g00ecf