Home
Tech Articles
Code Samples
Learn
Freelance Projects
Online Testing
Geek Talk
Job Postings
Knowledge Base
Geek Blogs
Question Bank
Interview Questions
Certification
Placement Papers
Tech FAQ
Career Advice
Engineering
Ask Question
I am new,
Sign me up!
User Name
Remember Me?
Password
Code Base
Submit Code
Back
Oracle
PHP
Java
ASP.NET
C#
Delphi
VB.NET
Perl
ColdFusion
SQL Server
MySQL
C
C++
UNIX
AJAX
Flash
HTML
CSS
Java Script
VB Script
XML
Python
MS Access
MainFrame
Perl Code Base
•
PassCripting - Crypt Perl Password
•
Currency Converter
•
PerlScript Array
•
PerlScript HTML Form
•
Simple PerlScript Loop
Code Samples
Perl
PerlScript HTML Form
Code Resource
Author:
srinivasaraobora
Difficulty Level
: Intermediate
Published:
25th Apr 2009
Read:
2083 times
Filed in:
Perl
Add Comment
This script is use to generate a html form
Sample Code
#!/usr/bin/perl
#programmatical.plx
use
warnings
;
use
CGI
::
Pretty
qw
(
:
all
)
;
use
strict
;
my
$cgi
=
new
CGI
;
print
header
(
)
;
if
(
$cgi
->
param
(
'first'
)
and
$cgi
->
param
(
'last'
)
)
{
my
$first
=
ucfirst
(
lc
(
$cgi
->
param
(
'first'
)
)
)
;
my
$last
=
ucfirst
(
lc
(
$cgi
->
param
(
'last'
)
)
)
;
print
start_html
(
"Welcome"
)
,
h1
(
"Hello, $first $last"
)
;
}
else
{
print
start_html
(
-
title
=>
"Enter your name"
)
;
if
(
$cgi
->
param
(
'first'
)
or
$cgi
->
param
(
'last'
)
)
{
print
center
(
font
(
{
-
color
=>
'red'
}
,
"You must enter a"
,
(
$cgi
->
param
(
'last'
)
?
"first"
:
"last"
)
,
"name"
)
)
;
}
print
generate_form
(
)
;
}
print
end_html
(
)
;
sub
generate_form
{
return
start_form
,
h1
(
"Please enter your name:"
)
,
p
(
"First name"
,
textfield
(
'first'
)
)
,
p
(
"Last name"
,
textfield
(
'last'
)
)
,
p
(
submit
)
,
end_form
;
}
Copyright GeekInterview.com
Next Article:
Currency Converter
Latest Code Samples
♦
PerlScript HTML Form
♦
Currency Converter
♦
Simple PerlScript Loop
♦
PerlScript Array
♦
PassCripting - Crypt Perl Password
Popular Code Samples
♦
PerlScript HTML Form
♦
Currency Converter
♦
Simple PerlScript Loop
♦
PassCripting - Crypt Perl Password
♦
PerlScript Array
Related Code Samples
»
PerlScript Array
»
Simple PerlScript Loop
»
Form Designer
»
RTF 2 HTML Converter
»
Using a VB.NET 2005 Class to Convert RichText to HTML
Post Comment
Members Please Login
Name:
Email:
(Optional. Used for Notification)
Title:
Comment:
Validation Code:
<=>
(Enter this code in text box)
Popular Coders
#
Coder Name
Hits
1.
srinivasaraobora
7135
Active Coders
#
Coder Name
Codes
1.
srinivasaraobora
5
Refined Tags
Sponsored Links
About Us
-
Privacy Policy
-
Terms and Conditions
-
Contact
Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved