[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-WebCGI] Re: Document contained no data



On 20000226.155548, Wolf Alexander Hauser <woffl@gmx.net> wrote:

>I wanted to run the following small perl programm ("demo.pl"):
>- ---------------------------------------------
>#!/usr/bin/perl
>
>print "Content-type: text/html\n\n";
>print "Hello, Wold!";
>- ---------------------------------------------

Hi!  Just a few thoughts....

1) are you saving the code as a .cgi file?  MacPerl requires that you 
save it in a special format to work on Macs.  However, when you upload it 
to a *nix or Wintel box, you need to upload the .pl file, renaming it to 
.cgi.

2) Mac servers differ from other servers in that they generally don't 
create _any_ headers for .cgi scripts.  So you really need to return 
something like:

$eol = "\015\012";
print "HTTP/1.0 200 OK", $eol, "Server: WebSTAR 4", $eol, "MIME-Version: 
1.0", $eol, "Content-type: text/html", $eol, $eol;

This contains all the headers neccesary. (You may be able to use HTTP/1.1 
instead.... read up about the requirements.  Also, change the Server 
field to be whatever server you're using...)

HTH,
Ricky

-----
Pukku


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org