Okay, getting a strange problem with Class::DBI. Using the example from the usage.
Music::Artist->set_sql(most_cds => qq{ SELECT artist.id, COUNT(cd.id) AS cds FROM artist, cd WHERE artist.id = cd.artist GROUP BY artist.id ORDER BY cds DESC LIMIT 10 }); my @artists = Music::Artist->search_most_cds();
I've also setup the temp column in Music/Artist.pm
__PACKAGE__->columns(TEMP => qw/cds/);
Everything appears to be fine and if I execute the SQL directly in the database I get the appropriate results with the counts that are correct. However, when the perl code spits out the data it appears to be missing the count (temporary cds column) on the first result. I've confirmed this by using Data::Dumper and this is what I'm seeing on my end (edited to match example).
$VAR1 = bless( { '__triggers' => {}, '_class_trigger_results' => [], ' +id' => '1' }, 'Music::Artist' ); $VAR2 = bless( { '__triggers' => {}, '_class_trigger_results' => [], ' +cds' => '2', 'id' => '2' }, 'Music::Artist' );
It's really late and that may have something to do with why I'm stumped but it's not making any sense what-so-ever.

UPDATE:
This only appears to be happening in mod_perl. I'm continuing to investigate. Any ideas, tips, feedback is appreciated.

-- koyrist

In reply to [mod_perl] Class::DBI temp columns missing on first result by koyrist

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.