in reply to Apply function "keys" directly to function returning hash
One way round this would be to return a hashref instead - something like this...
sub func { return {'a' => 'ah', 'b' => 'be'} }; print keys %{func()}; # a b [download]