in reply to Re: Associative array
in thread Associative array

the below code prints out the keys and values
print $data_pair->{'key'}; print $data_pair->{'value'};

Replies are listed 'Best First'.
Re^3: Associative array
by moritz (Cardinal) on Jul 13, 2009 at 06:25 UTC
    This doesn't print the keys and values, but the values associated with the keys key and value.

    If you want to print the hash out for debugging purposes, use Data::Dumper.

    If you want to access the keys/values in your program, use keys %{$data_pair} or values %{$data_pair} instead.