![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
hash table |
06/01/2012 |
lit un fichier contenant un hashtable. Le format du fichier est
_______________ val1=1 val2=2 etc. _______________En sortie on affiche la table de hashage.
val1->1 val2->2
# lecture du fichier open(FILE,"hash.txt"); my %hash; while () { chomp; my ($key, $val) = split /=/; $hash{$key} = $val; } close FILE; # affichage du hash my ($key,$val); while (($key,$val)= each(%hash)) { print "$key->$val\n"; }