Perhaps you could use glob.

$ perl -E ' > @digits = ( 1 .. 3 ); > $length = 4; > $globStr = qq{{@{ [ join q{,}, @digits ] }}} x $length; > say for glob $globStr;' 1111 1112 1113 1121 1122 1123 1131 1132 1133 1211 1212 1213 1221 1222 1223 1231 1232 1233 1311 1312 1313 1321 1322 1323 1331 1332 1333 2111 2112 2113 2121 2122 2123 2131 2132 2133 2211 2212 2213 2221 2222 2223 2231 2232 2233 2311 2312 2313 2321 2322 2323 2331 2332 2333 3111 3112 3113 3121 3122 3123 3131 3132 3133 3211 3212 3213 3221 3222 3223 3231 3232 3233 3311 3312 3313 3321 3322 3323 3331 3332 3333 $

I hope this is useful.

Cheers,

JohnGG


In reply to Re: Generating lists of strings by johngg
in thread Generating lists of strings by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.