in reply to Re: Infinite Loop Question
in thread Infinite Loop Question

Thanks for the quick response! There are no alarms coded in the script. Your second suggestion is something that I am not sure about. I will look into this. The third suggestion I believe I accounted for with a second nested infinite loop that tries to reconnect (using Net::FTP) until connection is reestablished. It then exits this loop with a last statement and returns to the overall infinite loop.

for(;;) {... my $host = something; my $ftp = Net::FTP->new($host, Timeout => 30); if (defined($ftp)) { my $TODAY = time; print LOG "Established ftp connection with $host\n"; print LOG "at: ", scalar(localtime($TODAY)), "\n"; } else { for (;;) { print LOG "Unable to make connection with $host\n"; print LOG "Try to reconnect in 5 secs to $host\n"; sleep 5; my $ftp = Net::FTP->new($host, Timeout => 60); if (defined($ftp)) { my $TODAY = time; print LOG "Established ftp with $host\n"; print LOG "at: ", scalar(localtime($TODAY)), "\n"; last; } } } ...}

Replies are listed 'Best First'.
Re^3: Infinite Loop Question
by elTriberium (Friar) on Nov 08, 2011 at 22:41 UTC

    What is the last message that's printed to LOG?

    That might help in finding the call that's causing the script to exit.