in reply to Regarding arrays
BTW: Is this homework?my @a1 = qw(ME K LE K HT ME LL); my @a2 = qw(10 4 1 5 6 7 19); my %h; $h{ $a1[$_] } += $a2[$_] for ( 0 .. $#a1 ); for (@a1) { next if (!exists($h{$_})); print $_ ."=". delete($h{$_}); } __END__ ME=17 K=9 LE=1 HT=6 LL=19
|
|---|