in reply to Re: Re: Re: for loop over large BLOCK keeps failing
in thread for loop over large BLOCK keeps failing

Thanks for the links to diagnostics and to strict ... and the typo in the code.

I'm still very confused, however, on why this code doesn't work with the for loop. If I comment out the two lines  for ($loop=0;$loop<=3;$loop++){ and the closing bracket } the code works fine. It seems the only problem is in the for loop statement.

I can't see my diagnostics ... I assume because I'm running my perl programs via the web where I just get an internal error banner when the program crashes. How do I go about seeing the diagnostics output in this case? Currently what I do to check to see if the program works is to upload it to the server and then run it by going to its url and refreshing the browser. Do you know how I could get the diagnostics to print out? cdherold

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: for loop over large BLOCK keeps failing
by chipmunk (Parson) on May 02, 2001 at 20:55 UTC
    Here are two things that should help immensely with debugging your CGI scripts...

    First, before you upload your script to the web server, make sure it compiles: perl -c myscript.cgi

    Second, use CGI::Carp to get more useful output when your script dies: use CGI::Carp qw/ fatalsToBrowser /; CGI::Carp by itself will produce nicely formatted error messages in the server's error log. Importing fatalsToBrowser will cause those errors to be sent to the browser as well.

    You can also use CGI::Carp's carpout method to create your own private error log in an easily accessible place, rather than using the server's.

      thank you very much for the cgi::carp hint. very helpful.

      cdherold