Perl : hachage

MethJy -  
 MethJy -
arf j ai un petit probleme avec un hachage voila je n arrive pas a additionner les valeurs de deux hachages ... pourtant ce sont bien des scalaires alors ou est la couille ???!!!

%hash = (
1 => 3,
2 => 8
);
%hashb = (
1 => 5,
2 => 3
);

@chaine = keys(%hash);

foreach (@chaine)
{
$hash{$_}+ $hashb{$_}= $hashc{$_};
print"$hashc{$_}";
}

thx d avance

1 réponse

  1. MethJy
     
    oups dsl mon erreur "$hash{$_}+ $hashb{$_}= $hashc{$_}; "

    plutot $hashc{$_}= $hash{$_}+ $hashb{$_}

    c bon ca marche ;)
    0