in reply to [untitled node, ID 460085]

Hi again
Thanks for the advice. I have tried everything that was suggested but the error still remains. When I run the script from the command line I get the following.
Content-Type: text/html; charset=ISO-8859-1 <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-U +S"><head><title>Untitled Document</title> </head><body>Your favorite Tapas place in Barcelona was green</body></ +html>
So, it seems to be working Ok per se. Maybe my server configuration still isnt quite right?

Replies are listed 'Best First'.
Re^2: simple cgi script error
by Amar (Sexton) on May 25, 2005 at 12:36 UTC
    I am wrote a small object oriented code snippet based on u r code.
    #!/usr/bin/perl use warnings; use strict; use CGI qw/:standard/; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); my $cgi=CGI->new(); print $cgi->header(); print $cgi->start_html(); my $value=$cgi->param('tapas'); ## No form check if possible print "Your favorite Tapas place in Barcelona was $value"; print $cgi->end_html();
    I haven't tested this, but should work

    Also, In your code code snippet, print the header first then try to call param().