http://www.perlmonks.org?node_id=1081397


in reply to `

To see what your hash looks like, you should use Data::Dumper like this: print Dumper \%PG; (you need to use the module first, of course).

To see what's wrong with your code :

use strict; use warnings;
because you use variables that were never declared, put a value in a hash that you then never use, mess up scopes, and other mistakes that strict and warnings should have told you about.