B
Bob
I would have expected the code below to sleep for 10 seconds, up to 15
tries, in attempting to open the data file before continuing. Instead
it *always* seems sleep 15 tries before continuing. Can someone please
tell what what I did wrong?
Thanks
..
..
..
$trycount=0;
main:
open(SAV, ">>$filename") || die (&wait_and_try_again);
..
..
..
..
print "Complete";
exit;
sub wait_and_try_again {
$trycount++;
if($trycount<16) { sleep (1); print "Slept: $trycount\n"; goto main;
}
exit;
}
tries, in attempting to open the data file before continuing. Instead
it *always* seems sleep 15 tries before continuing. Can someone please
tell what what I did wrong?
Thanks
..
..
..
$trycount=0;
main:
open(SAV, ">>$filename") || die (&wait_and_try_again);
..
..
..
..
print "Complete";
exit;
sub wait_and_try_again {
$trycount++;
if($trycount<16) { sleep (1); print "Slept: $trycount\n"; goto main;
}
exit;
}