but it complained about $_ undefined in m// match. So I then made the assignment to $_ explicit like so and it works great:while (<> and !/pattern/) {}
I am surprised by the need of doing this and would like to understand why. Thank you all!while (defined($_ = <>) and !/pattern) {}
In reply to $_ not set in while <> by pidloop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |