1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
use strict;
use AnyDBM_File;
my %Hash; # ton hash contenant les données
$Hash{pkg1} = "Bonjour comment ca va";
$Hash{pkg2} = "salut la suite";
my %HashFic; # pour la liaison avec ton(tes) fichier(s) DBM
# pour CREER un fichier DBM "toto" :
dbmopen(%HashFic, "toto", 0644) or die("oups, pb avec crea toto : $!");
%HashFic = %Hash;
dbmclose(%HashFic);
# pour LIRE LES DONNEES d'un fichier DBM "toto" :
dbmopen(%HashFic, "toto", 0644) or die("oups, pb avec recup toto : $!");
%Hash = %HashFic;
dbmclose(%HashFic); |
Partager