Actually you have several problems in your code. Most likely the main issue is that back ticks returns a string so assigning the result to an array is unlikely to be meaningful. With that in mind the value being pushed doesn't make sense. On top of that your while loops should really be for loops to better convey the intent of the loops. So, consider:

use strict; use warnings; my @results; for my $wibble (0 .. 4) { for my $wobble (0 .. 4) { my $result1 = `/home/devel/test1.ksh $wibble`; my $result2 = `/home/devel/test2.ksh $wibble`; push @{$results[$wibble][$wobble]}, "$result1;$result2"; } }

Completely untested of course and I'm sure there are better names than wibble and wobble for the two loop counters that convey the sense of what the loops are fore, but I can't guess what they may be.

True laziness is hard work

In reply to Re: Question about array reference by GrandFather
in thread Question about array reference by Pazzeo

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.