Here is the code to reproduce the problem:
sub hello { return (h => 1, n => 1); }
print join \", \", values hello();
I get the error:
I don't believe this is possible because Perl is not strongly enough typed to know what subroutines return.
As far as Perl is concerned, all subroutines simply return LISTs (or a single SCALAR). LISTs can have certain operations applied to them (indexing, slicing, etc.), but nothing that requires an ARRAY variable (like push, pop, shift) or a HASH variable (including keys, values, delete, exists).
Hash assignment takes in a LIST as a parameter (which your function returns), and creates an associative hash with every odd element serving as a key to the next even element. Only after this assignment can it be called a HASH in Perl's grammar, and therefore only then will it be usable in the values function.