Your comment does not match your code:

# Load data in array. foreach $i(0..$#{$rows}) { foreach $j (0..$#{$rows->[$i]} ) { $rows->[$i][$j]; } }

The code does nothing. It also doesn't make sense. You still haven't answered what you think this code should do.

Please read perldsc, perlreftut and use Data::Dumper to print out your data structure, so you can see what your data structure is and how to use it.

You keep talking about "email", but "email" seems to be largely unrelated to the problem you have here. If you think "It is as if the sql prepare holds on to the first value.", what steps did you try to validate or reject that idea? Dumping out your data structure is very helpful in these situations. If you "know the value changes, because it prints each time and email it each time", then the place where you are printing data must be different from the place where you try to use the data in Excel. Investigate these situations and find where your data deviates from your assumptions.

I'm sorry that I can't be of much more assistance - debugging a program is a process that you need to largely do yourself.


In reply to Re^7: SQL query using dynamic array by Corion
in thread SQL query using dynamic array by cocl04

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.