Si votre email correspond à un compte, vous recevrez un lien de réinitialisation.
j'aimerai faire un tableau associatif dont la value est elle meme untableau.perldoc perllol
j'aimerai faire un tableau associatif dont la value est elle meme un tableau. perldoc perllol
salut.j'aimerai faire un tableau associatif dont la value est elle meme untableau.un truc genre%mon_hash = ("cle", ["v1", "v2"]);ou, ["v1", "v2"] serait un tableau...du coup :while (($k, $v) = each(%mon_hash)){print $v[0];print $v[1];}devrait afficher 'v1v2'comment puis je faire?
merciEtienne
salut. j'aimerai faire un tableau associatif dont la value est elle meme un tableau. un truc genre %mon_hash = ("cle", ["v1", "v2"]); ou, ["v1", "v2"] serait un tableau... du coup : while (($k, $v) = each(%mon_hash)) { print $v[0]; print $v[1]; } devrait afficher 'v1v2' comment puis je faire?
merci Etienne
salut.j'aimerai faire un tableau associatif dont la value est elle meme untableau.un truc genre%mon_hash = ("cle", ["v1", "v2"]);ou, ["v1", "v2"] serait un tableau...du coup :while (($k, $v) = each(%mon_hash)){print $v[0];print $v[1];}devrait afficher 'v1v2'comment puis je faire?merciEtienne
salut. j'aimerai faire un tableau associatif dont la value est elle meme un tableau. un truc genre %mon_hash = ("cle", ["v1", "v2"]); ou, ["v1", "v2"] serait un tableau... du coup : while (($k, $v) = each(%mon_hash)) { print $v[0]; print $v[1]; } devrait afficher 'v1v2' comment puis je faire? merci Etienne
Juste pour te donner un exemple après les informations qui t'ont étédonnées :%mon_hash = ( ma_cle => ['v1','v2'],ma_cle2 => ['v3','v4'],);ensuite si tu veux parcourir ta structure :foreach my $key (keys %mon_hash) {print "ncle : $key => ";foreach my $item (@{$mon_hash{$key}}) { print "$item, "; }}devrait donner :cle : ma_cle => v1, v2,cle : ma_cle2 => v3, v4,A+Thibault
Juste pour te donner un exemple après les informations qui t'ont été données : %mon_hash = ( ma_cle => ['v1','v2'], ma_cle2 => ['v3','v4'], ); ensuite si tu veux parcourir ta structure : foreach my $key (keys %mon_hash) { print "ncle : $key => "; foreach my $item (@{$mon_hash{$key}}) { print "$item, "; } } devrait donner : cle : ma_cle => v1, v2, cle : ma_cle2 => v3, v4, A+ Thibault