Change keys $pupils{$class} to keys %{$pupils{$class}}
Or you could do it like this:
push @namelist, keys %{$pupils{$class}};
In reply to Re: foreach and hash of hashes
by jwkrahn
in thread foreach and hash of hashes
by momo33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |