in reply to Re: postfix "for" question?
in thread postfix "for" question?

Not quite.

perl -E 'map {say for 1..10} 1..5'

Replies are listed 'Best First'.
Re^3: postfix "for" question?
by karlgoethebier (Abbot) on Sep 14, 2023 at 21:44 UTC

    This was actually intentional as it looks better:

    Karl@h3002993:~$ perl -E 'map {say 1..10} 1..5' 12345678910 12345678910 12345678910 12345678910 12345678910

    Or:

    karl@h3002993:~$ perl -E 'map {say join " ", 1..10} 1..5' 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

    Compared to:

    karl@h3002993:~$ perl -E 'map {say for 1..10} 1..5' 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

    Update: Probably I meant  perl -E 'map {print for 1..10,"\n"} 1..5'

    «The Crux of the Biscuit is the Apostrophe»

      This was actually intentional as it looks better

      But the whole question is about nested loops. By changing the code to look different, you completely missed the point.