while (split(/[, ]+/, <DATA>)) { ... }
Only a while-loop condition expression like
assigns implicitly to $_ (see tybalt89's example) (update: but see kcott's post for a more complete discussion of $_ assignment special-casing). An arbitrary expression like split(...) does not. Had you had warnings enabled, Perl would have at least hinted at this problem.while (<DATA>) { ... }
Give a man a fish: <%-{-{-{-<
In reply to Re^3: Splitting in while loop
by AnomalousMonk
in thread Splitting in while loop
by tel2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |