J
john swilting
I do not understand .i start the deboguor ,is the file test.dat is well
execute.in the file main.pl the loop while does not seem to function
correctly. one only value is returned to me before keys. it appears
infinite
##########################################################################
#main.pl
##########################################################################
#!/usr/bin/perl
require "ouvre_fichier.pl";
$f = "test.dat";
%fh = ouvre_fichier($f);;
while(( $clef,$valeur) = each %fh){
print $clef;
keys %fh;
}
########################################################################
#ouvre_fichier.pl
########################################################################
!/usr/bin/perl
sub ouvre_fichier {
open ($F, $_[0]) || die "impossible d ouvrir le fichier : $!";
while($ligne =<$F>){
$str.= $ligne;
}
eval $str;
}
$f = 'test.dat';
while(1){
eval {
ouvre_fichier($f);#si ouvre fichier echoue, le programme ne se termine pas
};##et à mon avis c la dernier veleur utliser
last unless $@; #pas d erreur on sort de la boucle
print "$f est absent. entrez un nouveau nom de fichier $f";
chomp ($f = <STDIN>);
}
1
#######################################################################
#test.dat
#######################################################################
$Conf{XferMethod} = 'rsync';
$Conf{XferLogLevel} = '1';
$Conf{RSyncShareName} = '___1___';
$Conf{ClientNameAlias} = '___2___';
execute.in the file main.pl the loop while does not seem to function
correctly. one only value is returned to me before keys. it appears
infinite
##########################################################################
#main.pl
##########################################################################
#!/usr/bin/perl
require "ouvre_fichier.pl";
$f = "test.dat";
%fh = ouvre_fichier($f);;
while(( $clef,$valeur) = each %fh){
print $clef;
keys %fh;
}
########################################################################
#ouvre_fichier.pl
########################################################################
!/usr/bin/perl
sub ouvre_fichier {
open ($F, $_[0]) || die "impossible d ouvrir le fichier : $!";
while($ligne =<$F>){
$str.= $ligne;
}
eval $str;
}
$f = 'test.dat';
while(1){
eval {
ouvre_fichier($f);#si ouvre fichier echoue, le programme ne se termine pas
};##et à mon avis c la dernier veleur utliser
last unless $@; #pas d erreur on sort de la boucle
print "$f est absent. entrez un nouveau nom de fichier $f";
chomp ($f = <STDIN>);
}
1
#######################################################################
#test.dat
#######################################################################
$Conf{XferMethod} = 'rsync';
$Conf{XferLogLevel} = '1';
$Conf{RSyncShareName} = '___1___';
$Conf{ClientNameAlias} = '___2___';