my $aref = [ 1..5 ]; bless $aref, 'HASH'; # An array ref now thinks it's a hash ref print "aref is a HASH\n" if ref($aref) eq 'HASH'; print "aref is a HASH\n" if UNIVERSAL::isa($aref, 'HASH'); my $href = { 0..9 }; # This is ok print "href is a hash\n" if ref($href) eq 'HASH'; bless $href, 'Some::Package'; # This may not be ok print "href is not a hash\n" unless ref($href) eq 'HASH';