When having a reference, how can i detect what the data type is that it holds? Although perl is loosely typed, one still has warning/error messages that such or such variable isn't the array/hash/code you were looking for. Therefore there could be a way under certain circumstances.
my $result = do_me();
#is $result a code referece? -> $result->()
#is $result a scalar?