Ok, cleaned it up alot, and the only error I'm getting now is: "Can't use string ("AdAh") as ARRAY ref while "strict refs" in use. Also, "AdAh" is coming from the first element in array @list3. So, I have it narrowed down to this statement the below statment. Also, can I splice out elements from the arrays on the fly (without having any problems). Thanks in advance. if (substr($my_pocket, 0, 2) eq substr($array_of_lists{$key}[$t], 0, 2)) Code:
my %array_of_lists = ('0' => [@list3], '1' => [@list4], '2' => [@list8 +99]); #my @array_of_lists = (@list3, @list4, @list899); ##Set my hand my $my_pocket = 'AcAd'; my ($key, $t); for $key ( 0 .. scalar(keys %array_of_lists)) { #The loop will iterate through each element (hand of current h +andlist) of the current row and remove any #hand that contains the cards assigned randomly above. for $t ( 0 .. scalar @{$array_of_lists{$key}} ) { #If the first card of the random hand above equal the firs +t card in the element I am currently on, then remove the element from + this handlist by #splicing it out. Or if the first card of the random hand +above equal the second card of the element (hand) I am currently spli +ce it out. if (substr($my_pocket, 0, 2) eq substr($array_of_lists{$ke +y}[$t], 0, 2)) { $array_of_lists{$key} = splice(@{$array_of_lists{$key} +}, $t, 1); } elsif (substr($my_pocket, 0, 2) eq substr($array_of_lists{ +$key}[$t], 2, 2)) { $array_of_lists{$key} = splice(@{$array_of_lists{$key} +}, $t, 1); } elsif (substr($my_pocket, 2, 2) eq substr($array_of_lists{ +$key}[$t], 0, 2)) { $array_of_lists{$key} = splice(@{$array_of_lists{$key} +}, $t, 1); } elsif (substr($my_pocket, 2, 2) eq substr($array_of_lists{ +$key}[$t], 2, 2)) { $array_of_lists{$key} = splice(@{$array_of_lists{$key} +}, $t, 1); } } }

In reply to Re^2: working with hashes of arrays by Anonymous Monk
in thread working with hashes of arrays by gman1983

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.