Here's the code:
[perl]
($var1, $var2, $var3, $var4, $var5, $var6) = $DBIgetAllEntries->fetchrow_array;
return %fields if $DBIgetAllEntries->errstr;
%fields = (
'var1' => $var1,
'var2' => $var2,
'var3' => $var3,
'var4' => $var4,
'var5' => $var5,
'var6' => $var6,
);
return %fields;
[/perl]
A little more information would help a lot.
-Andy
here is the whole subroutine it's from :
[perl]sub getFields {
my $entryNumber = shift @_;
my %fields = ();
my($url, $title, $description, $keywords, $density, $checksum, $stale);
my $DBIgetAllEntries = $database->prepare("SELECT * FROM searchTable") or return 0;
$DBIgetAllEntries->execute;
($url, $title, $description, $keywords, $density, $checksum, $stale) = $DBIgetAllEntries->fetchrow_array;
return %fields if $DBIgetAllEntries->errstr;
%fields = (
'url','$url',
'title','$title',
'description','$description',
'keywords','$keywords',
'density','$density',
'checksum','$checksum',
'stale','$stale',
);
return %fields;
}
[/perl]
I'm really only interested in the url, title, description, keywords, and density variables...the other two I dont' need.
This subroutine is for a site search engine, and the %getfields hash is used to parse out the data and return matches for the search portion of the application.
:)
The difference between not getting anything back and hanging forever is pretty significant. Is the function returning or isn't it?