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

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.

Replies are listed 'Best First'.
Re^6: Embedded Newlines or Converting One-Liner to Loop
by LanX (Saint) on Dec 15, 2016 at 14:32 UTC
    > 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!