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

I thought you were asking why there was no separation of the email addresses in the second and third lines of the output shown. Seems like I got that wrong: sorry.

I did go back and studied the question more closely. I note that you've used identical code for both the "prints nothing" and the "prints something":

while (split(/[, ]+/, <DATA>)) { print @_ }

I suspect the first block should have "print $_", not "print @_".

— Ken

Replies are listed 'Best First'.
Re^8: Splitting in while loop
by tel2 (Pilgrim) on Oct 10, 2021 at 03:45 UTC
    Good point Ken.  Thanks for bringing this to my attention.
    The 2nd bit of code was meant to be I meant to contain while (@_ = split(/[, ]+/, <DATA>)) as per jwkrahn's claim of equivalence that I was responding to.
    I've updated that post now, thanks.