%a = ( "KEY" => {
"p1" => 1 , [1223],
"p1" => 2 , [2323],
"p1" => 3 , [2353],
}
);
I want to generate a structure like this. I have tried with this code:
@array = ( 1223 , 2323 ,2353 );
$count = 0;
foreach my $i (@array) {
$a{"KEY"} => { "p1" => $count , [$i] };
$count++;
}
How can I create such a hash?