$hash = {A1 => 'AB', A2 => '', A3 => ''}; # read info from file open (INFH,$myfile); create_array(*INFH, $hash, \$arry_hash); for $i (0 .. $#arry_hash) { for $key (keys %{$arry_hash[$i]}) { print "key :$key = $arry_hash[$i]->{$key} "; } print "}\n"; } sub create_array { my $FH = shift; my $rec_hash = shift; my $arry_ref = shift; while (<$FH>) { $tmp_hash = $rec_hash; for $field (spilt ',') { ($key, $value) = split /=/, field; chomp($value); $tmp_hash->{$key} = $value; } push @$arry_ref, {%tmp_hash}; } close ($FH); }