Title: Defined/Undef
1Defined/Undef
my hash or hash() defined hash false,
hash is empty hash1one exists(hash1
)defined(hash1)true undef
hash1 exists(hash1)
false defined(hash1)true delete
hash1 exists(hash1)
false defined(hash1)false
my i if( defined i ) false i0 if(
defined i ) true
2Basic HTML
ltHTMLgt ltHEADgt ltTITLEgtDocument Titlelt/TITLEgt
lt/HEADgt ltBODYgt Hello World! lt/BODYgt lt/HTMLgt
3File Names
www.nonocnn.com/ www.nonocnn.com/some/ Webserver
displays a default (in most cases)
file index.html if it doesnt exist then all
files in that directory are listed. To protect
server information, usually this option (file
listing) is switched off.
4ltpgt Paragraph ltpgt Next Paragraph. And line ltbrgt
break. ltpgt Unordered List (UL) ltULgt ltLIgt We
Love Perl. ltLIgt We Love Perl ltbgt IN BOLD lt/bgt
ltLIgt ltigt We Loooove Perl lt/igt ltLIgt Now, We
Love HTML Too! lt/ULgt Horizontal rule
(HR) ltHRgt ltpgt Ordered List (OL) ltOLgt ltLIgt
We Love Perl. ltLIgt We Love Perl ltbgt IN BOLD
lt/bgt ltLIgt ltigt We Loooove Perl lt/igt ltLIgt
Now, We Love HTML Too! lt/OLgt
5ltA HREF"http//www.cs.tau.ac.il/"gt Link To
www.cs.tau.ac.il lt/Agt ltpgt Images ltimg
src"http//www.cs.tau.ac.il/images/tau.jpg"gt ltp
gt ltfont colorbluegt Image Options lt/fontgt ltimg
src"http//www.cs.tau.ac.il/images/tau.jpg"
width"102" height"49" border3
COLOR"FFFFCC"gt ltpgt Tables lttablegt lttrgt
lttdgt ltfont colorredgt Cell 1.1 lt/fontgt
lt/tdgt lttdgt Cell 1.2 lt/tdgt lt/trgt lttrgt lttdgt
Cell 2.1 lt/tdgt lttdgt ltfont colorcyangt Cell 2.2
lt/fontgt lt/tdgt lt/trgt lt/tablegt
6 ltpgt Table Options lttable aligncenter border5
cellspacing10 cellpadding20gt lttrgt lttd
alignleftgt ltfont colorredgt Cell-----------------
---1.1 lt/fontgt lt/tdgt lttdgt Cell-------------------
-1.2 lt/tdgt lt/trgt lttrgt lttdgt Cell---------------
-----2.1 lt/tdgt lttdgt ltfont colorcyangt
Cell--------------------2.2 lt/fontgt lt/tdgt lt/trgt
lttrgt lttd alignleftgt Aligned left lt/tdgt lttd
alignrightgt Aligned right lt/tdgt lt/trgt lt/tablegt
7CGI - Common Gateway Interface
- CGI a standard that defines the protocol
between a web server and a application (script).
http/ ssl
Web Browser
Web Server
DB
CGI
Application
search example
8Sending information to CGI
- Two ways to submit information
- HTML form
- With URL
ltform action"/cgi-bin/scilib.pl"
methodPOSTgt ltinput typetext namesearchj
value""gt ltinput typesubmit value"search"gt lt/for
mgt
http//www.tau.ac.il/cgi-bin/scilib.pl?searchjpro
tein
9CGI - Simple script
!/usr/bin/perl use CGI qw(standard) print
header param param('formtext') print
"lthrgtltp alignleftgtHello CGI param" print
end_html