jeudi 2 juin 2016

perl-strange test behaviour

excerpt from my code :

for $SS (0..scalar @TAB_SS-1)
{
    print Dumper ("av",$CUMUL,$PCTVOLTMP,$TAB_SS[$SS][1]);
    $CUMUL = $CUMUL + $TAB_SS[$SS][1];
    print Dumper ("ap",$CUMUL,$PCTVOLTMP);
    if ($CUMUL >= $PCTVOLTMP)
    {
        Calcul_Date($TAB_SS[$SS][0]);
        $DATE = "$Auj_j/$Auj_m/$Auj_4a";
        $HEURE = "$H:$MI:$S";
        printf("%3d%-25s%8s%3s%8s\n",$PCTTMP," % en volume atteints le ",$DATE, " à ",$HEURE);
        $PCTVOLTMP = $PCTVOLTMP + $PCTVOL;
        print Dumper ("Prochaine étape ",$PCTVOLTMP);
        $PCTTMP = $PCTTMP + $PCT;
    }
}
printf("Volume total sauvé : %6.2f GB\n",$TAILLC / 1000000000);

For reasons I can't find, sometimes (but reproductible), program does not enter in the test to print data as expected.

Put some print to look for something weird, but no way...

Here is what is displayed when working (only the last lines here) :

$VAR1 = 'av';
$VAR2 = '4722181648752';
$VAR3 = '4770868299648';
$VAR4 = 92984872;
$VAR1 = 'ap';
$VAR2 = '4722274633624';
$VAR3 = '4770868299648';
$VAR1 = 'av';
$VAR2 = '4722274633624';
$VAR3 = '4770868299648';
$VAR4 = '46893768708';
$VAR1 = 'ap';
$VAR2 = '4769168402332';
$VAR3 = '4770868299648';
$VAR1 = 'av';
$VAR2 = '4769168402332';
$VAR3 = '4770868299648';
$VAR4 = 1699897316;
$VAR1 = 'ap';
$VAR2 = '4770868299648';
$VAR3 = '4770868299648';
100 % en volume atteints le 24/05/2016 à 07:15:40
$VAR1 = 'Prochaine étape ';
$VAR2 = '5247955129612.8';
Volume total sauvé : 4770.87 GB

and when not working :

$VAR1 = 'av';
$VAR2 = '4325103606080';
$VAR3 = '4337435336392';
$VAR4 = 1119865540;
$VAR1 = 'ap';
$VAR2 = '4326223471620';
$VAR3 = '4337435336392';
$VAR1 = 'av';
$VAR2 = '4326223471620';
$VAR3 = '4337435336392';
$VAR4 = '11122370688';
$VAR1 = 'ap';
$VAR2 = '4337345842308';
$VAR3 = '4337435336392';
$VAR1 = 'av';
$VAR2 = '4337345842308';
$VAR3 = '4337435336392';
$VAR4 = 89494084;
$VAR1 = 'ap';
$VAR2 = '4337435336392';
$VAR3 = '4337435336392';
Volume total sauvé : 4337.44 GB

Any help/clue would be very appreciated...

Aucun commentaire:

Enregistrer un commentaire