Hi! Ok. Been trying out writing the function similar to yours for past two days and I have a question here.

I tried running the similar code on my script and I get the error message whereby it stated that

can't use string ("0") as an ARRAY ref while "strict refs" in use at l +ine 119. Only hard reference allowed by "strict refs".
SO I change the value here for this part (0 to 3) and I add in the main for loop:
for my $dataratio(@full_data){ for my $six ( 3 .. $columns ){ for my $tre ( 3 .. $rows ){ for my $tri ( 3 .. $rows ){ } } }
can't use string ("M11") as an ARRAY ref while "strict refs" in use at + line 119. Only hard reference allowed by "strict refs".
Ok. i think I am doing something wrong here. So for my( $d_h ) = @_; how do you actually exclude out the first three columns of full_data (e.g. M11, M12..)? Another question is this code:
1+$six, 1+$tri, 1+$tre, $tri, $six, $tre, $six, ;;; $ratio[ $six ][ $tri ][ $tre ] = $$d_h[ $tri ][ $six ] + / $$d_h[ $tre ][ $six ] ;
I do not understand how this part works. Hope you can nudge me in the right direction?

In reply to Re^15: How to store the output from foreach loop into variable/array without printing? by hellohello1
in thread How to store the output from foreach loop into variable/array without printing? by hellohello1

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.