Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!D:/Perl/bin/perl #bonus.pl - calculates a bonus amount and creates a dynamic Web page #that contains form data and a bonus amount print "Content-type: text/html\n\n"; use CGI qw(:sandard -debug); #prevent Perl from creating undeclared variables use strict; #declare variables my ($name, $sales, $rate, $bonus); #assign values to variables $name = param('Salesperson'); $sales = param('Sales'); $rate = param('Rate'); #calculate bonus amount $bonus = $sales * $rate; #create Web page print "<HTML>\n"; print "<HEAD><TITLE>Patton Industries</TITLE><BASEFONT SIZE=5></HEAD>\ +n"; print "<H1>Bonus Calculation</H1>\n"; print "<BODY>\n"; print "Salesperson: $name<br>\n"; print "Your bonus is: $bonus<br>\n"; print "You entered a sales amount of $sales and\n"; print " a bonus rate of $rate <br>\n"; print "</BODY>\n"; print "</HTML>\n";
Edit: Removed <br> tags from code, per request. larsen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Undefined subroutine &main error
by chromatic (Archbishop) on Mar 07, 2003 at 18:53 UTC | |
|
Re: Undefined subroutine &main error
by Enlil (Parson) on Mar 07, 2003 at 18:57 UTC | |
by skki (Initiate) on Mar 07, 2003 at 19:29 UTC | |
|
Re: Undefined subroutine &main error
by cfreak (Chaplain) on Mar 07, 2003 at 20:10 UTC | |
by skki (Initiate) on Mar 08, 2003 at 00:59 UTC | |
|
Re: Undefined subroutine &main error
by skki (Initiate) on Mar 07, 2003 at 19:27 UTC |