in reply to postfix "for" question?

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

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^2: postfix "for" question?
by ikegami (Patriarch) on Sep 14, 2023 at 12:50 UTC

    Not quite.

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

      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.