Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Understanding compiletime vs. runtimeby punkish (Priest) |
on Feb 04, 2005 at 03:56 UTC ( [id://427915]=perlquestion: print w/replies, xml ) | Need Help?? |
punkish has asked for the wisdom of the Perl Monks concerning the following question:
I have the following in my script
My logic is thusly -- if something is wrong enough for the script to not compile, it will write the reason in foo.err and die rightaway. However, if compilation is successful, then it will try to connect to the IMAP host. If that fails, it will write to foo.log and go to sleep for a specified time, and then wake up and try again. Except, my logic is wrong. If the connection to the IMAP host fails, the error gets written to foo.err and the script dies. This indicates that the script is checking for the IMAP host connection right at compile time. What am I doing wrong, and how can I achieve what I want? What I want is -- after the script starts up successfully, I want it to make the connection to the IMAP host. If successful, do the rest of its stuff, else write a note in the log and go to sleep only to try again later. Update: Stranger still... if the connection fails, I get an error in foo.err, and yet, I also get "connected successfully" in foo.log. This is most bewildering.
Back to
Seekers of Perl Wisdom
|
|