The Ghost wrote:
How can I get the information out of the hashes?
sub somthing {
while (my $ref = $sth->fetchrow_hashref()) {
foreach my $col (keys %{$ref}) {
$results[$x]{$col}=$ref->{$col};
}
$x++;}
return (@results); }
Then later:
(I don't understand this part)
foreach my $result (@results) {
foreach my $key (keys {$results[$x]}) {
print "$key: $result{$key}\n";
The value of $result is a reference to a hash so you have to dereference it
properly:
foreach my $key ( keys %$result ) {
print "$key: $result->{$key}\n";
} }
perldoc perldata
perldoc perllol
perldoc perldsc
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>