CGI - Fatal error creating secondary file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tovenkatesh82
    New Member
    • Mar 2007
    • 30

    CGI - Fatal error creating secondary file

    Hi

    I wrote a cgi code and in output another cgi file is getting created.....jus t
    have a look on the code...

    Code:
    #!/usr/bin/perl
    use strict;
    use CGI::Carp qw(fatalsToBrowser);
    die ’Some disaster!’;
    print "Content type:text/plain\n\n";
    print "hello";
    here is the output:

    Code:
    Content-type: text/html
    
    <H1>Software error:</H1>
    <PRE>Unrecognized character \x92 at C:\Program Files\Perl Express\Debug\temp1.cgi line 4.
    </PRE>
    <P>
    For help, please send mail to this site's webmaster, giving this error message
    and the time and date of the error.

    how is the temp1 file getting generated?
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    are you running this as a CGI? Looks like you are on windows, so the shebang line is probably wrong:

    #!/usr/bin/perl

    maybe it should be:

    #!c:/per/bin/perl.exe

    my guess is the server is creating the temp file as a last resort since it doesn't know where else to send the error message.

    Comment

    • tovenkatesh82
      New Member
      • Mar 2007
      • 30

      #3
      shebang line does not makes a difference for this case.

      Originally posted by KevinADC
      are you running this as a CGI? Looks like you are on windows, so the shebang line is probably wrong:

      #!/usr/bin/perl

      maybe it should be:

      #!c:/per/bin/perl.exe

      my guess is the server is creating the temp file as a last resort since it doesn't know where else to send the error message.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        whats with the unusual quotes in this line in your post?

        Code:
        die ’Some disaster!’;
        instead of ' your code has reverse back-tiks `

        when I run your code I get:

        Unrecognized character \x92 at C:\PROGRA~1\PER LBU~1\debug\spb dtest.cgi line 6.

        Are you trying to test the die function? All your code will do is die.

        Comment

        Working...