hipnoodle has asked for the wisdom of the Perl Monks concerning the following question:
However, when I try to return the $ref to the calling subroutine and process it there, I get no data. In fact, I don't even get any table cells. Your help is greatly appreciated.my $ref = $sth->fetchall_arrayref; for my $rec (@$ref){ $query_results .= "<tr>"; no warnings; for my $field (@$rec) {$query_results .= "<td>$field</td>"; } $query_results .= "</tr>"; } $sth->finish(); $dbh->disconnect(); return($query_results);
my $ref = &select_query($sqlstatement); for my $rec (@$ref){ $query_results .= "<tr>"; no warnings; for my $field (@$rec) {$query_results .= "<td>$field</td>"; } $query_results .= "</tr>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to return $ref from: $ref = $sth->fetchall_arrayref;
by diotalevi (Canon) on Mar 15, 2006 at 00:17 UTC | |
|
Re: How to return $ref from: $ref = $sth->fetchall_arrayref;
by ioannis (Abbot) on Mar 15, 2006 at 01:13 UTC | |
by hipnoodle (Novice) on Mar 20, 2006 at 13:43 UTC |