get_page_content(\%variables, "names"); # instead of %variables = get_page_content("names"); sub get_page_content { my ($hashref, $type) = @_; my $dbh = DB_File::connect(); $sth = $dbh->prepare (qq{ SELECT `name`,`value` FROM `page_variabl +es` WHERE `type` = ? }); $sth->execute($type); while(my ($db_name,$db_content) = $sth->fetchrow_array()) { $$hashref{$db_name} = $db_content; } $sth->finish(); }
In reply to Re: Re: adding to a hash
by Thelonius
in thread adding to a hash
by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |