which wasn't working. I switched towhile( shift @array ) { some_operation $_; }
and that seemed to work fine. This surprised me. I looked up $_ in the camel book and I found that Perl will assume $_ for "various unary functions" and "various list functions" (in the section on Global Special Variables). This is rather vague. So when is $_ used and when isn't it?foreach( @array ) { some_function $_; }
In reply to When does $_ get used? by elbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |