2)can someone please explain to me in plain english what@guesses is in scalar context there, so it produces the number of elements in the array. That is used as an index to assign to an element of the array. Since the pre-assignment elements are numbered 0 through (@guesses - 1), it adds a new element to the end of the array.$guesses[@guesses]=$guess;
A much clearer way to write it would be:
push @guesses, $guess;
In reply to Re: hangman question
by ysth
in thread hangman question
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |