in reply to hash help

Since you stuff everything in hashes, you can use them to look up.

my %result; for my $key (keys %pr1, keys %si1) { my @values; push @values, @{$pr1{$key}} if $pr1{$key}; push @values, @{$si1{$key}} if $si1{$key}; $result{$key} = join ', ', @values; }

The code above is not completely done, but it should get you in the right direction. Please do also consider more clear variable names. Names like $pr1 is an indicator of bad design.

Replies are listed 'Best First'.
Re^2: hash help
by bkish11 (Novice) on Jun 29, 2009 at 04:21 UTC

    I would take your sugeestions, my script is very initial stage, gathering data from different file,the reason I choose hash of array, in future I would be able to manupulate the data more flexiable and am still learning perl,I apperciate your help.If am worng please correct me

    I have simillar so many keys like bbbb_rf1,ccc_12,in mutiple files, I should be able gather all the data and merge to a sinle table. you are always welcome to suggest better directopns.