Thanks in advance and your answer is most helpful.
I am fetching two arrayofhashref
using $sth->fetchall_arrayref({})
from Database let's a and b where
a= [
{
'name' => 'test',
'id' => '10',`enter code here`
},
{
'name' => 'foo',
'id' => '22',
}
];
b= [
{
'dept' => 'IT',
'mob' => '880978'
},
{
'dept' => 'CSE',
'mob' => '877687'
},
];
The o/p should be :
a= [
{
'name' => 'test',
'id' => '10',
b= [
{
'dept' => 'IT',
'mob' => '880978'
},
{
'dept' => 'CSE',
'mob' => '877687'
},
];
},
{
'name' => 'foo',
'id' => '22',
b= [
{
'dept' => 'IT',
'mob' => '880978'
},
{
'dept' => 'CSE',
'mob' => '877687'
},
];
}
];
I did like :
my $count = 0;
foreach my $row (@$a){
$a->[$count]{b} = $b;
$count++;
}
If I pass $b as "heloo" it is working fine , but how can I pass this array of hash ref ?