I have a two hashes with the same key but different values.
%HASH1
ERROR MESSAGE1 => A1
ERROR MESSAGE2 => A2
ERROR MESSAGE3 => A3
ERROR MESSAGE4 => A4
%HASH2
ERROR MESSAGE1 => C4
ERROR MESSAGE2 => C5
ERROR MESSAGE3 => C6
ERROR MESSAGE4 => C7
My code looks like this
my %errordata;
for my $key (keys %hash1) {
$errordata{$key} = [ $hash2{$key}, $hash1{$key} ];
}
use Data::Dumper;
print Dumper \%errordata;
So, my question is how can I print the values without the first hash's values based on the code above? because I tried doing a while loop but it shows the ARRAY(0x2113a30) instead.
while (my($g,$w) = each %errordata)
{
print "$_" for @{$w};
}
Thank you.
EDIT
output should something like this
ERROR MESSAGE: ERROR MESSAGE1
FULL PATH: A1
LINE: C4