in reply to Infinite Loop Question

joeymac:

The only things I can think of are:

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Infinite Loop Question
by joeymac (Acolyte) on Nov 08, 2011 at 19:34 UTC

    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; } } } ...}

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

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