in reply to Re: Date::Day issues
in thread Date::Day issues

OK. thanks for the reply. The problem is its just not writing the HTML file.. the code is obviously bombing out around where i introduce this code. I cant troubleshoot properly because i am adding the extra lines of code into something that is already live, It only runs once a day at 5pm. Its on a scheduled task and i cant read any errors msgs off the console. I guess i should try and create some kind of logfile.
conal.

Replies are listed 'Best First'.
Re^3: Date::Day issues
by ikegami (Patriarch) on Mar 25, 2010 at 07:38 UTC

    The problem is its just not writing the HTML file..

    The printf in your code isn't conditional. If it was reached, it printed something out somewhere, or returned an error. Did it succeed or return an error? What error?

      no it didnt print anything out. I cant get to see the error cos the script is 'live' and on a scheduled task and i cant see the console. can you recommend some way of dumping out error msgs to a log file or something that isnt too obtrusive ? i dont want to be hacking at the code too much as it runs critical tasks every 30minutes. thanks.
      conal.
        Your printf statement does not appear in the original code that you copied, and claim to be the source of the problem.

        Is the output file empty, and has the date/time stamp been updated? Are you testing the open to check that the file handle is created? Are you running with use warnings; and use strict;?

        Do you not have a test system? If you don't then this might be a good time to justify having one.

        How did you check if the print succeeded if you didn't run it.

        I didn't say anything about outputting the error to the console. But then again, you're asking about printing problems.

        I didn't say anything about touching your live script. Recreate the problem with another script. You might have to execute it in a manner similar to your live script if it's a permission issue.

        Note: If the file isn't being created, it's not likely that the print is the culprit. Check the result of open.