Basically, I am wondering if it would be better to use a hash or what I am using, an array that points to other arrays (3d array); I have x,y,z layers. x is the outside layer and has (0..6) values, each one different. The y layer is a list of vertex for the z layer which is a list of blocks. Each block has a different number of vertex, but each vertex has the same number of elements. OK what I am trying to do is put in another vertex in the middle of the list of vertex, yet in doing so I must also add the elements that go with it. I need to know how to put it in and shift those vertex after it. I know that this is the second time that I have looked for advice about this, but I am seriously confused. Here is some things that I have tried, but have not exactly worked out.
OK $datapoint[$kk][3] is just a block number $blocks[][][] is a reference to the array
$t0 = 11111; $t1 = $datapoint[$kk][1]; $t2 = $datapoint[$kk][2]; $t3 = 0; $t4 = 0; $t5 = 99999; $t6 = 1111; for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][0]; $blocks[$datapoint[$kk][3]][$rr][0] = $t0; $t0 = $temp0; } for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][1]; $blocks[$datapoint[$kk][3]][$rr][1] = $t1; $t1 = $temp1; } for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][2]; $blocks[$datapoint[$kk][3]][$rr][2] = $t2; $t2 = $temp2; } for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][3]; $blocks[$datapoint[$kk][3]][$rr][3] = $t3; $t3 = $temp3; } for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][4]; $blocks[$datapoint[$kk][3]][$rr][4] = $t4; $t4 = $temp4; } for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][5]; $blocks[$datapoint[$kk][3]][$rr][5] = $t5; $t5 = $temp5; } for my $rr (($jj + 1)..(($#{$blocks[$datapoint[$kk][3]]}) )) { $temp1 = $blocks[$datapoint[$kk][3]][$rr][6]; $blocks[$datapoint[$kk][3]][$rr][6] = $t6; $t6 = $temp6; } $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][0] += $t0; $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][1] += $t1; $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][2] += $t2; $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][3] += $t3; $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][4] += $t4; $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][5] += $t5; $blocks[$datapoint[$kk][3]][($#{$blocks[$datapoint[$kk][3]]}) + 1][6] += $t6;
And on the second one, I do not know what values I need to put in for the $a and $b in  reverse($a..$b) Should $a be the place that I want to put the new value, and should $b be one less than the last value of the list?
for $i6 ((reverse (($jj + 1))..($#{$blocks[$datapoint[$kk][3]]}) - 1)) + { $blocks[$datapoint[$kk][3]][$i6 + 1][1] = $blocks[ +$datapoint[$kk][3]][$i6][1]; $blocks[$datapoint[$kk][3]][$i6 + 1][2] = $blocks[ +$datapoint[$kk][3]][$i6][2]; $blocks[$datapoint[$kk][3]][$i6 + 1][3] = $blocks[ +$datapoint[$kk][3]][$i6][3]; $blocks[$datapoint[$kk][3]][$i6 + 1][4] = $blocks[ +$datapoint[$kk][3]][$i6][4]; $blocks[$datapoint[$kk][3]][$i6 + 1][5] = $blocks[ +$datapoint[$kk][3]][$i6][5]; $blocks[$datapoint[$kk][3]][$i6 + 1][6] = $blocks[ +$datapoint[$kk][3]][$i6][6]; }

update (broquaint): added <readmore>


In reply to Hash or not? by stu96art

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.