I thought shift should return the array element, so why do I need to use $_ = shift ... ?Because the implied $_ = in a while condition only happens for readline aka <>.
Also, with shift you don't get the implied defined() around the while condition; if one if the elements of @letters is "0", the loop will stop early. Try while (defined($_ = shift @letters))
In reply to Re^2: Assigning an array to a scalar
by ysth
in thread Assigning an array to a scalar
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |