Greetings monks,
So, I've never written a CGI before, and I'm trying to get my feet wet, so to speak. In playing around with CGI, I've discovered something that I find a bit wierd. First the code:
#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
print header();
print start_html("This is a test");
print start_form();
print end_form();
Pretty standard, eh? Well, when I run this, I get the following output:
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>This is a test</title>
</head><body>
Use of uninitialized value in length at (eval 9) line 11.
<form method="post" action="/test.pl" enctype="application/x-www-form-
+urlencoded">
Notice the "uninitialized value" warning. From what I've been able to ascertain, the trouble starts with the start_form sub. I looked at the documentation for CGI, and it seems like it is reasonable to call start_form sans arguments. Also, I looked at CGI.pm's source, specifically at the startform sub. I'm able to clear the warning if I provide a query string, or if I provide an action to the subroutine. Perhaps I'm making too much out of it, but I would like this to run clean under warnings. Any insight would be appreciated.
</form>
thanks in advance,
thor