in reply to Re^3: Embedded Newlines or Converting One-Liner to Loop
in thread Embedded Newlines or Converting One-Liner to Loop

Just a minor nitpick, your test cases doesn't cover an escaped double quote.

Adding a line like ,"3.5 "" disks", might help. :)

edit

And you wouldn't need to check defined $buffer if you used a do-while loop.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^5: Embedded Newlines or Converting One-Liner to Loop
by Marshall (Canon) on Dec 15, 2016 at 13:30 UTC
    Fair enough. Good comments.

    Added a test case. I personally prefer the while(){} vs the do {}while() because I like to see the ending condition right up front. But I understand that opinions vary.

      > I like to see the ending condition right up front.

      Sure, but do-while makes it explicit that you always want the first loop to happen and in tis case the body isn't to large.

      BTW: I like how you solved it with nested iterators, that's IMHO the cleanest approach! :)

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!