my %test = ('test1'=>'value', 'test2'=>'value'); my $hash_ref = \%test; print "hash ref" if($hash_ref =~ m{HASH});