use Scalar::Util qw( reftype ); my $blessed = bless {}, 'My::Class'; my $hashref = {}; printf "blessed is ref %s\n", ref $blessed; printf "blessed is reftype %s\n", reftype $blessed; printf "hashref is ref %s\n", ref $hashref; printf "hashref is reftype %s\n", reftype $hashref;