We are new to Perl but not programming. To start, we got a Perl manual and loaded Sambar server on our laptop so we could test Perl Cgi scripts. We wrote a simple script that accepts data (1 field) from an html form. Here's the script:
#!C:\perl\bin\perl -w
# Script: form1test.pl works with form1test.html
use strict;
use CGI ':standard';
my $value;
$value = param('yourname');
print "content-type: text/html\n\n";
print "The name you entered is $value";
Problem: When we run form via localhost, we hit submit and the browser comes back with Page Not Found. If we take out the -w on line 1 and comment out some of the lines, the script will execute (but obviously the $Value will not display as it has been removed).
Is Sambar an acceptable server?( We run Windows-XP Pro) Or should we use another Server for localhost? Here's the modified script that does work:
#!C:\perl\bin\perl -w
# Script: form1test.pl works with form1test.html
#use strict;
#use CGI ':standard';
#my $value;
#$value = param('yourname');
print "content-type: text/html\n\n";
print "Your Name will display here";
Thank you in advance. John
2006-07-07 Retitled by Corion, as per Monastery guidelines
Original title: 'New To Perl'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.