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

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?

Replies are listed 'Best First'.
Re^4: Date::Day issues
by Conal (Beadle) on Mar 25, 2010 at 07:47 UTC
    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.
        yes the file is being created , but for whatever reason printf isnt putting anything into it.

        i am just changing the code to show the date as a day with that method from Date::Day, the original source just prints the day and date in numbers. And that works just fine.

        I dont have a test system, no.. its a relatively complex set of applications of which the perl script is just one component.

        The perl script doesnt have use warnings; and  use strict; The code is all a little hacky tbh, its something i wrote years ago. I guess i should sit and down and sort it all out once and far all.. but the systems i use here rely on it running 24/7.

        But i will take your advice and try and think of creating some kind of test environment. thanks.

        conal.

      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.