diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-02-01 19:54:05 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-02-01 19:54:05 -0500 |
commit | 81331da338fd27d03b2c34aa5bf721e69dabea2d (patch) | |
tree | 839334e9c56df1a79de35fc5cc8cbfa90c6a3af3 /lib | |
parent | f14c1c7b57f779360fb93f5e638bb94869733b02 (diff) | |
download | games-word-81331da338fd27d03b2c34aa5bf721e69dabea2d.tar.gz games-word-81331da338fd27d03b2c34aa5bf721e69dabea2d.zip |
stop looping once we go off the end of one of the strings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Games/Word.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Games/Word.pm b/lib/Games/Word.pm index 948828e..93a0fd7 100644 --- a/lib/Games/Word.pm +++ b/lib/Games/Word.pm @@ -77,6 +77,7 @@ sub shared_letters_by_position { my @letters = (); while (my ($a, $b) = (pop @a, pop @b)) { + last unless (defined $a && defined $b); if ($a eq $b) { push @letters, $a; } |