in reply to Re^4: Generating lists of strings
in thread Generating lists of strings

nFor would require:

local $, = ", "; local $\ = "\n"; nFor { print map $lists[$_][ $_[$_] ], 0..$#_; } map 0+@$_, @lists;

Baloney! You just like complicated don't you.

All that's needed is the intuative:

my @list1 = qw( apple orange tomato ); my @list2 = qw( dog cat platypus ); my @list3 = qw( 1 2 III ); nFor{ print join ' ', $list1[ $_[0] ], $list2[ $_[1] ], $list3[ $_[2] ], } ( 3 ) x 3;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^6: Generating lists of strings
by ikegami (Patriarch) on Jan 25, 2010 at 02:54 UTC
    You assume they all have the same number of elements.

      Yup! The OPs problem description.

      How about you try and find one SoPW here calling for the iteration of a varible length list of variable length lists?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        That was in response to you bringing the hypothetical need to change nFor. What the OP wants is irrelevant since that doesn't require changing nFor.