in reply to Re: how to determine of fetchrow_Arrayref is empty?
in thread how to determine of fetchrow_Arrayref is empty?

fetchrow_hashref wouldn't work with what the OP is doing for each row (at least, not without a lot of hassle).
  • Comment on Re^2: how to determine of fetchrow_Arrayref is empty?

Replies are listed 'Best First'.
Re^3: how to determine of fetchrow_Arrayref is empty?
by doom (Deacon) on May 27, 2008 at 18:35 UTC

    The OP hasn't actually made the ultimate goal clear -- my guess would be that a comma separated list of all fields is just an intermediate step while learning how to use DBI.

    Starting with fetchrow_hashref and using a stub like this is probably a better place to begin:

    foreach my $field_name (keys %{ $row_href }) { my $value = $row_href->{ $field_name }; print "$field_name: $value \n"; }

    And if the order of the fields is important, you can replace keys %{ $row_href } with an array @field_names... typically, you have that information already, since you need it to build the SELECT.