ketaki has asked for the wisdom of the Perl Monks concerning the following question:

whats the problem with this statement...
$body.= "<br><br>The excel file you just uploaded conatins $co +ls columns<br><br>";
when i make this line into a comment, then the program runs and gives output, but when i remove the comment (i mean when the command is executed) then it gives me a error 500: Script Execution Failure any help? ketaki

Replies are listed 'Best First'.
Re: whats the problem with this line?
by pc88mxer (Vicar) on Jul 17, 2008 at 14:42 UTC
    What does your server error log say? If you can't read your error log, try putting:
    use CGI::Carp qw(fatalsToBrowser);
    in your script.

    Also, what kind of thing is $cols? Is it a simple scalar, or it is an object that has a stringify method? We will probably need to see more of your script.

Re: whats the problem with this line?
by marto (Cardinal) on Jul 17, 2008 at 14:43 UTC
    Your webserver error log should give you more hints as to what is wrong (error_log if you are running Apache by the way). Does the script run properly from the command line? Does $cols exist and contain what you think it should contain? Perhaps you should read some of the posts under CGI Programming from the tutorials section of this site.

    Martin
Re: whats the problem with this line?
by Perlbotics (Archbishop) on Jul 17, 2008 at 14:44 UTC
    Maybe $cols is not declared while in a use strict context?
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: whats the problem with this line?
by LesleyB (Friar) on Jul 17, 2008 at 15:35 UTC

    Apart from the spelling mistake ;) ... you could use #!/usr/bin/perl -wT; or at least use warnings; to help you debug your code.

    This will output warnings as well as error messages to your error log file - /var/log/apache2/error.log on my system.