in reply to Re^2: Splitting in while loop
in thread Splitting in while loop

while (split(/[, ]+/, <DATA>)) { ... }

Only a while-loop condition expression like

while (<DATA>) { ... }
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.


Give a man a fish:  <%-{-{-{-<