my $ref_to_anon={ a=>1 }; my %named=(a=>1); my $ref_to_named=\%named; # realistically there is no way to tell which ref is to an anonymous array