in reply to Returning multiple values from a function

You can return only a scalar or a list from a function. To get a hash return, you either have to flatten it into a list (and reconstruct it at the other side) or return a reference to the hash.

Perhaps you want:

return \%results, $type;
and
my ($results_hashref, $type) = findResults(); foreach my $key (sort keys %$results_hashref) { ... } # etc

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.