in reply to Calling a cgi with another cgi

Just a little more insight into what may be happening. After trying most of your fine suggestions, it seems these ideas would work except fot the header I use: "print "Content-type: text/html\n\n";" However, this script will not run without that header in place. Just errors out with: Internal Server Error. So - it's looking like I have to abandon the idea of doing a redirect from this particular script, unless I can find a replacement for that header that will still allow the script to run.

Replies are listed 'Best First'.
Re: Re: Calling a cgi with another cgi
by jarich (Curate) on Oct 17, 2002 at 08:05 UTC
    Donnie you haven't shown us any of your code yet, but perhaps you're getting the "Internal Server Error" because the script you're redirecting to doesn't print out the required http header itself?

    For example:

    #!/usr/local/bin/perl -w ##### file1.cgi use CGI; use strict; my $q = new CGI; print $q->redirect( -uri => 'file2.cgi' ); exit; ##### cut here ##### #!/usr/local/bin/perl -w ##### file2.cgi print "foo"; exit;
    will cause an internal server error because we're not printing out the required HTTP header. Our webserver doesn't care what script prints out that header, but it does expect that it'll be printed out before anything else is. If we change file2.cgi to be:
    #!/usr/local/bin/perl -w ##### file2.cgi use CGI; use strict; my $cgi = new CGI; print $cgi->header(); print "foo"; exit;
    we don't get any error.

    Perhaps that is something you need to check.

    jarich