Johnson, Reginald (GTS) wrote:
> Uri,
> Thank you for the assistance. I have incorporated data dumper and the "
> " into the code. What I find odd is that data dumper shows the values of
> the hash as I expect them to be. Yet still when I print I get a hex
> number.
> 
> My output 
> 
> Enter the filename of input file with full path
> /tmp/reggiej
> 6
> policy_name = test2 has 6 elements
> this is element i=0  test2
> this is element i=1  MS-Windows-NT
> this is element i=2  Silver
> this is element i=3  NPRO30DINCR
> this is element i=4  Client JXWGTI7R5CHD1 WINDOWS NT
> this is element i=5  Schedule test2_full_1700 FULL 604800
> 
> $VAR1 = {
>           'test2' => {
>                        'element_5' => 'Schedule test2_full_1700 FULL
> 604800
> ',
>                        'element_0' => 'test2',
>                        'element_3' => 'NPRO30DINCR',
>                        'element_4' => 'Client JXWGTI7R5CHD1 WINDOWS NT',
>                        'element_2' => 'Silver',
>                        'element_1' => 'MS-Windows-NT'
>                      }
>         };
> test2 => HASH(0xbf35c)

Below, you need to loop another level deeper. Your $key is a hash name,
which is fine, but the $value is also a hash (anonymous), which is why
you are seeing HASH(0x...). Try this (please note that it's untested):

>                 print Dumper( \%policy_Hash);
>                 while ( my ($key,$value)= each %policy_Hash ) {
>                         print "$key => $value \n";
>                 }

while ( my ( $top_key, $top_val ) = each %policy_Hash ) {
        
        while ( my ( $second_key, $second_val ) = each %$top_val ) {
                print "$top_key: $second_key => $second_val\n";
        }
}

See [perldoc perldsc][1]

Steve

[1]: http://perldoc.perl.org/perldsc.html#HASHES-OF-HASHES

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to