Forms using Perl CGI & Apache 2.2

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Forms using Perl CGI & Apache 2.2

Postby todddyer » 11. February 2012 06:18

Howdy all,

I am running ActivePerl 5.14.2 & Apache 2.2.

I have been trying to get a simple form working using Perl/CGI, and I cannot get the buttons to show up in my browser.

I am running my cgi scripts from a browser, and the titles will show up okay, but no input buttons.

Here are a couple of examples:

This script:

#!C:\perl\bin\perl.exe -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;

print header;
print start_html("Thank You");
print h2("Thank You");

my %form;
foreach my $p (param()) {
$form{$p} = param($p);
print "$p = $form{$p}<br>\n";
print end_html;

Yields this output: (just the title and not the form is displayed)

Thank You

Here is another example:

This script:

#!C:\perl\bin\perl.exe -wT
use CGI;
$q = new CGI;
$name = $q->param('name');
$address = $q->param('address');
print "Content-type:text/html\n\n";
<title>Thank You Page</title>
<h1>Thank you for filling out my form!</h1>
Thank you, $name, for filling out my form!
I will mail information to $address right away.

Yields this result:

Thank you for filling out my form!
Thank you, , for filling out my form! I will mail information to right away.

No input asked for.

I am such a noob at this. Can anyone point me in the right direction? I am not even sure what to check next to begin troubleshooting.

Posts: 3
Joined: 09. February 2012 05:41
Operating System: Windows 7

Re: Forms using Perl CGI & Apache 2.2

Postby JonB » 14. February 2012 14:03

My honest suggestion is that you get a book on Perl, its a tough conceptual language. (that's what I did/do, I have dozens of books on Perl, PHP MySQL and so forth)

Here's a good one:

Learning Perl

You don't have to have the latest edition, unless you 'really plan' to be a Perl Programmer or if you want to learn the 'latest techniques' and language features. You can buy older editions for a few bucks on or eBay.

There are code examples to follow, and O'Reilly Books publishes the most titles on Perl - they are kinda the gold standard. I have 6 OR books on Perl currently.

Good Luck
User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests