Map is not a native Pascal type. The fgl unit defines several generic prototypes for maps. All of which have a Count property.
my $n = keys %mymap;
In scalar context, the keys operator returns a count of the keys in the hash. BUT, a hash can contain other hashes, as well as lists, nested arbitrarily. This only counts the top elements.