Home
|
Ask Question
|
Interview Questions
|
Tech FAQ
s
|
Engineering
|
Company
|
Geek Forums
|
Interview Coaching
|
Online Quiz
|
Interview eBook
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:
4272 times
Filed in:
Perl
Add Comment
Sponsored Links
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
♦
PassCripting - Crypt Perl Password
♦
Currency Converter
♦
Simple PerlScript Loop
♦
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 Your Comment:
Members Please Login
Your Name:
*
e-mail ID:
(required for notification)
*
Image Verification:
Subscribe
Popular Coders
#
Coder Name
Hits
1.
srinivasaraobora
17424
Active Coders
#
Coder Name
Codes
1.
srinivasaraobora
5
Refined Tags
Copyright © 2012 GeekInterview.com | All Rights Reserved