I've parsed JSON into the following data structure:
$VAR1 = {
'041012020' => {
'item_number' => 'P2345'
},
'041012021' => {
'item_number' => 'I0965'
},
'041012022' => {
'item_number' => 'R2204'
}
};
I'm trying to get the values of item_numbers using the following code, and it's giving me the HASH Values as output rather than the actual item_number values. Please guide me to get the expected values.
foreach my $value (values %{$json_obj}) {
say "Value is: $value,";
}
Output:
Value is: HASH(0x557ce4e2f3c0),
Value is: HASH(0x557ce4e4de18),
Value is: HASH(0x557ce4e4dcf8),
If I use the same code to get the keys it's working perfectly fine
foreach my $key (keys %{$json_obj}) {
say "Key is: $key,";
}
Output:
Key is: 041012020,
Key is: 041012020,
Key is: 041012022,