First, <code> tags are your friends - please read Writeup Formatting Tips.
This issue you are encountering is a question of scalar context for an array. Your first code tests $_ to see if it is false and exits the loop if it is. When you enter your control character, that evaluates to false and the while loop exits. You second code checks @_. Since this is an array, in scalar context (such as a conditional), it evaluates to the number of elements contained therein. Since it contains 1 element, it is true and thus the loop will not break. Read perldata for more details.
In reply to Re: <input> for array
by kennethk
in thread <input> for array
by manish.rathi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |