you can use a glob for that, though usually it is a bad idea to do so:
sub check_limit (\*) {
my $glob = shift;
my $name = *{$glob};
$name=~/^\*/%/;
my $num = keys %{*$glob};
print "Hash: $name has $num keys\n";
}
our %foo = qw(q w e t y j f f);
check_limit(*foo);