-
Start with the shebang line:
#!/usr/local/bin/perl
-
Use the CGI.pm library, and create a new CGI object:
# Use the CGI.pm library
use CGI;
# Make a new CGI object.
$query = new CGI;
-
Next, use the CGI.pm methods to write the start of the form:
# Write out the content-type header followed by a blank
line.
print $query->header;
# Write the HEAD section, including the title.
print $query->start_html("String Concatenation");
-
Then, retrieve the first name and last name.
$firstName = $query->param('firstName');
$lastName = $query->param('lastName');
-
After that, print a welcome message, using the first and last names.
You can:
-
concatenate them into one string ahead of time using the . operator, or
-
use double quotes to have Perl interpret the scalars on the fly, or
-
use both methods.
Whatever you do, I leave this implementation up to you. See me if
you have questions.