in reply to Re^2: Class::DBI error?
in thread Class::DBI error?

Given that $thread is a blessed object your code
for ( $thread ) { my %data2; $data2{author} = $thread->author; $data2{date} = $thread->date; $data2{content} = $thread->content; push @d_body, \%data2; }
is equivalent to
push @d_body, {}; $d_body[-1]->{$_} = $thread->$_ for ("author", "date", "content");
Still I don't see why you need @d_body. I would simply use
my $d_body; $d_body->{$_} = $thread->$_ for ("author", "date", "content");
and later in the code
body=> [$d_body],


holli, /regexed monk/

Replies are listed 'Best First'.
Re^4: Class::DBI error?
by stonecolddevin (Parson) on Jun 10, 2005 at 12:30 UTC
    Ahhh good thinking...wow that was simple
    meh.