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

Fair point, Ken, but I was just trying to concisely demonstrate that there was stuff-all in @_ with one bit of code, and the addresses in the other bit, so the 2 bits of code could not be equivalent.

Replies are listed 'Best First'.
Re^7: Splitting in while loop
by kcott (Archbishop) on Oct 08, 2021 at 05:12 UTC

    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

      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.