---------- Original Message ----------------------------------
From: Matt Cauthorn <[EMAIL PROTECTED]>
Date: Thu, 10 May 2001 08:43:34 -0700 (PDT)

>Chip -- try this in your cgi bin. Type perldoc CGI for more info.
>
> #!/usr/bin/perl -w
> use CGI qw/:standard/;
> print header,
>       start_html('hello world'),
>       h1('hello world'),
>       end_html;
>
>-- Cgi.pm makes everything easy. In your code below, you fogot > to put the first

This is interesting - check this out -
---------------------------------------
-rwxr-xr-x   1 chip  users    158 May 10 09:25 try.cgi  
is the name of this file you sent me:
#!/usr/bin/perl -w 
   use CGI qw/:standard/; 
   print header, 
          start_html('hello world'), 
          h1('hello world'), 
          end_html; 
---------------------------------------
-rwxr-xr-x   1 chip  users    187 May 10 09:30 try2.cgi
is the name of a file I wrote, give same results:
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "<body><head><title>My first script</title></head>";
print "<body bgcolor=\"white\"><h1>Hi there!</h1></body></html>";
---------------------------------------
this is the html calling above:
<html><head><title></title>
</head><body>
<form action="/cgi-bin/try.cgi" method="post">
<input type="submit" value="HitMe!">
</form></body></html>
(just change try.cgi to try2.cgi for the other version)
----------------------------------------
Results of running the above html in browser:
try.cgi results in server error:from error_log:
Premature end of script headers:/usr/local/apache/cgi-bin/try.cgi 
try2.cgi works
Some more info:
bash-2.04$ perl -c try.cgi
try.cgi syntax OK
bash-2.04$ perl -c try2.cgi
try2.cgi syntax OK
  
DB<1> v
'CGI.pm' => '2.46 from /usr/libdata/perl/5.00503/CGI.pm'
'Carp.pm' => '/usr/libdata/perl/5.00503/Carp.pm'
'Exporter.pm' => '/usr/libdata/perl/5.00503/Exporter.pm'
'Term/Cap.pm' => '/usr/libdata/perl/5.00503/Term/Cap.pm'
'Term/ReadLine.pm' => '/usr/libdata/perl/5.00503/Term/ReadLine.pm'
'overload.pm' => '/usr/libdata/perl/5.00503/overload.pm'
'perl5db.pl' => '1.0402 from /usr/libdata/perl/5.00503/perl5db.pl'

I don't know how to use the debugger. I entered perl -d try.cgi and it started 
working, then at the prompt I entered n for the next line, it asked for name=value 
pairs, so I entered Hi There then I don't know what to do next, ctrl-d interrupts it, 
so I'm not getting to the end of the program properly.

Hope this helps. I can write a simple cgi like the one above and it works, but when I 
download or copy/paste one, like the one you sent me, it doesn't work. wierd or what?

On the FBSD machine I use the ee editor, via telnet from my NT machine. On the NT 
machine I am trying UltraEdit32, then save the file to the FBSD box through network 
neighborhood path.

--
Chip

Reply via email to