in reply to Grab return values of different type from a sub

__func__ will always return an array or scalar as currently presented.

I would suggest you return a reference ie. return \%myhash OR return \@myarray ... in the "inner function" and use ref to determine what was returned, but if you can't mess with the code there is a problem.

You can't tell if a scalar an array or a hash was the intended return type without repeating the conditional flow.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."