...I am a bit confused...

Me too, but I may not have had enough coffee, yet.

I don't see that your program's strictly doing what you want it to do, i.e., forming a new order of these strings, since you could be randomly selecting the same element from @X_info multiple times, creating a new set of strings (but perhaps that's what you do want).

However, if your goal is to randomly shuffle the array of strings n times, while maintaining that set of strings, then consider the following:

use warnings; use strict; use List::Util qw/shuffle/; my $runs = 1000; my $range = 1553; my @array = ( 'A' .. 'Z' ); @array = shuffle @array for 1 .. $runs * $range; print "@array";

Output:

E I C M P Y D B F Q U J X R V T Z H S N G A O W K L

Hope this helps!


In reply to Re: A Question with Nesting Arrays by Kenosis
in thread A Question with Nesting Arrays by ccelt09

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.