After running your code through my spaghetti strainer, the only thing i can think of is that you are forgetting to dereference $headers - and since you probably are not using strict, the typo is easily overlooked. Try this instead:
foreach $header (@$headers) { ... }
Hope that does it for you. :)

Oh yeah! <plug> Take a look at DBIx::XHTML_Table </plug> ;)

It might be as simple as:

use strict; use DBIx::XHTML_Table; my $table = DBIx::XHTML_Table->new("insert db credentials"); $table->exec_query(" select data_name, sum(data_value) from dwhs.store_reports where report_type = ? and timestamp >= sysdate - ? group by data_name ",[$list_name,$day_list]); $table->modify_tag(table => { border => 3, cellspacing => '0', cellpadding => '0', width => '100%', }); $table->modify_tag(td => { bgcolor => '#CCCCCC', align => 'center', }); print $table->get_table();
But this depends on what is happening in your first query that creates the table header. My module merely uses the column names as the header (i _think_ that that's what you are doing) . . . maybe i should allow a hook to replace the headers . . . but i digest. :)

jeffa

    A flute with no holes is not a flute . . .
a doughnut with no holes is a danish.
                                - Basho,
                                  famous philosopher

In reply to (jeffa) Re: passing array value to hash not happening by jeffa
in thread passing array value to hash not happening by swarddb

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.