This is not an answer but I am puzzled by your use of @indices. It contains the integers from 0 to 80 and is used in only one function

my @indices = ( 76, 46, 21, 15, 33, 20, 69, 65, 40, 11, 79, 22, 70, 43, 32, 30, 57 +, 19, 39, 37, 62, 3, 4, 44, 51, 58, 25, 72, 64, 59, 48, 80, 42, 38, 61 +, 75, 49, 1, 18, 71, 41, 2, 67, 13, 45, 60, 9, 7, 28, 6, 8, 54, 50 +, 73, 56, 53, 77, 27, 16, 29, 52, 10, 24, 5, 26, 36, 23, 34, 31, 47, 14 +, 35, 12, 55, 17, 0, 68, 74, 66, 78, 63 ); #number of the columns. ... sub genotype { my @seq; my @gene; my @string; push @gene, shuffle @indices; ... }
this can be rewritten as
my $max_index = 80; ... sub genotype { my @seq; my @gene = shuffle 0 .. $max_index; my @string; ... }
which makes your intent clearer and avoids the possiblity of missing an integer.


In reply to Re: Problem of referencing into subroutines. by hipowls
in thread Problem of referencing into subroutines. by zli034

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.