Just because you're using random numbers doesn't mean you should use random indentation for your code; it makes reading very hard.

A good way to format code is to start in the first column, and indent a fixed amount of spaces (for example 4) for each level of unclosed curly brace. See also: perlstyle. This is not just a question of aesthetics, it's a necessity for any nontrivial program.

I don't quite understand your code, and what you want to achieve; one comment says random columns for selection have been created, but I don't see any created columns; you just print some numbers to standard output, but never record them in a data structure, so they are essentially lost to the program.

##this bit of the script is not working ### # @uniform = $random_number; # my @temp = map { [ $_[1], $_[0], $_ ] } # step +1 # map { $_->[2] } # step 2 # @uniform;

It's not working because after the line @uniform = $random_number;, the array @uniform contains a single number. Whereas the map accesses the array elements as if there were array references stored in the array.

My general advise is to don't use map until you understand what your variables contain, and the basic control flow. Data::Dumper can help you with the former.

Perl 6 - links to (nearly) everything that is Perl 6.

In reply to Re: Selecting, matching and counting column elements, using randomly generated numbers by moritz
in thread Selecting, matching and counting column elements, using randomly generated numbers by $new_guy

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.