diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-02-02 05:42:33 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-02-02 05:42:33 -0500 |
commit | c25bb1bd704d55b25d8009968d29a82ca3a45d72 (patch) | |
tree | 47575316bc30a9f1bad5bb68d5ea85db25c061aa /lib/Games/Word.pm | |
parent | 7e1056629c29d99e75db4dd82b29c0eddb954a4d (diff) | |
download | games-word-c25bb1bd704d55b25d8009968d29a82ca3a45d72.tar.gz games-word-c25bb1bd704d55b25d8009968d29a82ca3a45d72.zip |
make sure we don't catch 0 here
Diffstat (limited to 'lib/Games/Word.pm')
-rw-r--r-- | lib/Games/Word.pm | 6 |
1 files changed, 3 insertions, 3 deletions
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 = ''; |