Example is in PHP but i want to create same associative 2d array in perl and how to print that array. EX in PHP:-
while($row=mysql_fetch_array($rc))
{
$associative_array[$ClientCode]=array('PartnerCode'=>$row["PartnerCode"],
'OldPartnerCode'=>$row["OldPartnerCode"],
'ClientCode'=>$ClientCode,
'OldClientCode'=> $row["OldClientCode"]);
}
Adding OP's comment:
If 2d array creation is correct then how to print that array.
$sql_sel="select client_id,partner_id,client_code,partner_code from $tblname";
$sth = $dbh->prepare($sql_sel);
$sth->execute();
$nrow=$sth->rows;
while( ($ccode,$pcode,$old_ccode,$old_pcode) = $sth->fetchrow_array) {
$ccode =~ y/A-Z/a-z/;
$pcode =~ y/A-Z/a-z/;
$old_ccode =~ y/A-Z/a-z/;
$old_pcode =~ y/A-Z/a-z/;
$client_partner_hash->{$ccode}={
'newclinetcode'=>$ccode,
'newpartnercode'=>$pcode,
'oldclinetcode'=>$old_ccode,
'oldpartnercode'=>$old_pcode
};
}