in reply to Document Contain No Data

...what's troubling here is that your problem occurs intermittently. Normally, if the problem is consistent, you can see what's happening by testing the program from the command-line on the server. In fact, I always recommend that you know what the program does from the command-line environment before you deploy it on your web server.

Since this only occurs intermittently, I am guessing that under certain input conditions, your program is producing an error message or simply not creating a body of the document.

You might consider adding code that you can use to learn what input has been supplied when the failure occurs. Then by checking your web server log for the time stamp of the failure, then look at your custom logged information for clues as to what sort of input causes your script to produce either no data, or the empty document.

If the problem occurs frequently enough that you can trap it in a relatively short period, you might want to consider running your script in such a way that it logs its output to a file as well as sending it to STDOUT (as the Unix tee(1) command might do)

Good luck

...All the world looks like -well- all the world, when your hammer is Perl.
---v

Replies are listed 'Best First'.
Re: Re: Document Contain No Data
by HamNRye (Monk) on Nov 05, 2002 at 23:56 UTC

    POST CODE!!!!!!!!!

    Most likley you are not supplying the value of one of your variables.

    This is where good debugging techniques come in handy. Litter your script with some print "Passed 1st loop\n"; type debugging messages and see how far the program gets.

    ANYTHING that gets values from a command line script should check for value....

    $foo = `dir C:\bar\`; unless ($foo ne "") {die("Could not get directory listing\n");} @foobar = split '', $foo;

    Oh, yeah, post yer code!!!!

    And do you have warnings and Strict turned on??

    #! /usr/bin/perl -w use Strict;

    Are you using CGI.pm?? What about

    $co = new CGI; print $co->header, $co->start_html(-title=>'Retail Ad Usage');
    ~Hammy