Retourner au contenu associé (journal : Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..))
Posté par miRe le 20 janvier 2009 à 19:28. En réponse au journal Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..). Évalué à 1.
my %hash = (1,"toto",2,"tata"); myfunc(\%hash); sub myfunc { my $rhash = shift; while (my ($key,$value) = each %$rhash){ print "$key = $value\n"; } }
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: T'as tout compris
Posté par miRe . En réponse au journal Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..). Évalué à 1.
petit exemple de passage d'une table de hashage par référence :
my %hash = (1,"toto",2,"tata");
myfunc(\%hash);
sub myfunc {
my $rhash = shift;
while (my ($key,$value) = each %$rhash){
print "$key = $value\n";
}
}