while (my @row = $sthNames->fetchrow_array ()) { my $P = \%{$rpt{NAME}{$row[0]}}; $P->{PHONE1} = $row[1]; $P->{PHONE2} = $row[2]; }