Always use use warnings;
!
my %i_hash = undef;
my %p_hash = undef;
gives
Odd number of elements in hash assignment at a.pl line 6.
Use of uninitialized value in list assignment at a.pl line 6.
Odd number of elements in hash assignment at a.pl line 7.
Use of uninitialized value in list assignment at a.pl line 7.
You didn't provide a value for the value element, so undef
is used after issuing a warning.
Keys are strings and the stringification of undef
is the empty string, though doing so issues a warning.
You want:
my %i_hash;
my %p_hash;