|
 |
 |
To access the contents, click the chapter and section titles.
Perl CGl Programming: No experience required.
(Publisher: Sybex, Inc.)
Author(s): Erik Strom
ISBN: 0782121578
Publication Date: 11/01/97
Index
Note to the Reader: Throughout this index, first-level entries are boldface. Boldface page numbers indicate primary discussions of a topic. Italic page numbers indicate illustrations.
Symbols
- & (ampersand)
- as logical AND operator (&&), 301, 409
- in URLs, 121, 124
- >> (append operator), 97, 98
- * (asterisk) in regular expressions, 132
- @ (at sign) in lists, 2425
- \ (backslash)
- for escaped characters in Perl, 1920
- newline character (||n), 19
- in regular expressions, 132
- { } (braces) in subroutines, 52
- ^ (caret) in regular expressions, 132
- , (comma) in file handle syntax, 101
- $ (dollar sign)
- global variable ($!), 170, 408
- in regular expressions, 132
- scalars and, 23, 97
- (double quote)
- escaped double quote (||), 20
- in lists, 26
- == (equal to operator), 105
- ! (exclamation point)
- in comments, 18
- global variable ($!), 170, 408
- not equal to operator (!=), 105
- / (forward slash) in UNIX, 15
- > (greater than operator), 105
- >= (greater than or equal to operator), 105
- << (here operator), 296297
- < (less than operator), 105
- <= (less than or equal to operator), 105
- || (logical OR operator), 155, 170, 409
- != or <=> (not equal to operators), 105
- ( ) (parentheses)
- in regular expressions, 133
- in while statements, 77
- % (percent sign)
- in associative arrays, 72
- in URLs, 121, 124
- . (period)
- directory notation in UNIX and Windows, 238
- in regular expressions, 132
- string concatenation operator, 226227
- + (plus sign)
- in regular expressions, 132
- in URLs, 124
- # (pound sign)
- as comment character in hosts files, 6061
- as comment character in Perl, 15, 18
- in server-side includes directives, 189
- ? (question mark) in regular expressions, 132
- < > (redirection operators), 9798
- ; (semicolon) in Perl, 19
- (single quote) in lists, 26
- _ (underscore) in Perl, 5455
A
- abs function, 346
- accept function, 346
- access counters. See counters
- ActiveX controls, 34
- adding
- boilerplate to HTML documents, 191, 192194, 193
- guest book entries, 166168, 168, 169
- addresses
- gethostbyaddr function, 308310, 357358
- getnetbyaddr function, 358359
- IP addresses, 409
- and controlling counters, 103106
- hosts files and, 6062, 61, 305306
- in log files, 219, 235
- programming for, 305306
- resolving with Perl, 306311, 308
- loopback addresses, 61
- alarm function, 346347
- Allen, Paul, 279
- ampersand (&)
- as logical AND operator (&&), 301, 409
- in URLs, 121, 124
- analyzing programming problems, 9192, 92
- AND operator (&&), 301
- Apache Web server software, 283, 406
- append operator (>>), 97, 98
- applets, 5, 406
- applet extension to HTML, 260, 263
- Application MIME type, 83
- applications, parent and child applications, 6970, 70
- arguments, 18
- ARGV lists, 293
- arithmetic operators, 99
- Arnold, Ken, 304
- arrays. See also lists
- associative arrays, 72, 406
- delete function, 352
- each function, 7677, 353
- initializing, 7375
- keys function, 76, 366367
- sorting, 8182, 82, 385
- values function, 76, 393
- join function, 366
- pack function, 130131, 170173, 373374
- pop function, 374
- reverse function, 379
- shift function, 383
- splice function, 385386
- split function, 386
- decoding URL query strings, 126127
- extracting log file information, 223227, 225
- unshift function, 392393
- wantarray function, 394
- asterisk (*) in regular expressions, 132
- at sign (@) in lists, 2425
- atan2 function, 347
- attributes of SGML elements, 256
- Audio MIME type, 84
- automating URLs with frames, 107109, 108, 109
- awk command in UNIX, 9
B
- backslash (\)
- for escaped characters in Perl, 1920
- newline character (||n), 19
- in regular expressions, 132
- BASEFONT Netscape HTML extension, 260
- Berkeley Systems Development (BSD) UNIX, 303304
- Berners-Lee, Tim, 400401
- bind function, 347
- binmode function, 347
- bless function, 347
- BLINK Netscape HTML extension, 260
- boilerplate, adding to HTML documents, 191, 192194, 193
- Boolean values, 152
- braces ({ }) in subroutines, 52
- browsers, 401403, 402, 406
- communications with HTTP servers, 5657
- deciding which to support, 282, 284
- Java applets and, 5
- BSD (Berkeley Systems Development) UNIX, 303304
- bus architecture, 273
C
- C and C++ languages, 406
- argv lists, 293
- as CGI programming languages, 3132, 31
- #include directive, 51
- UNIX and C language, 910, 10
- caller function, 348
- capitalization. See case
- caret (^) in regular expressions, 132
- case
- case sensitivity in Perl, 23
- lc function, 367368
- lcfirst function, 368
- CENTER Netscape HTML extension, 260
- central processing units (CPUs). See microprocessors
- CERN (European Laboratory for Particle Physics), 190, 400401, 406
- CGI (Common Gateway Interface), 6, 2634, 5659, 6687, 406407
- CGI programming languages, 3134
- ActiveX controls, 34
- C and C++, 3132, 31
- JavaScript, 56, 6, 34
- proprietary CGI methods, 34
- shell scripts, 3334
- Visual Basic, 3233, 33
- CGI specification information, 30
- displaying environment variables in HTML documents, 7282
- display program explained, 7576
- each function, 7677, 353
- running the example, 7780, 78, 79
- sorting associative arrays, 8182, 82
- while statements, 7677
- writing the display program, 7275
- environment variables, 30, 30, 6682, 103104, 407
- common variables listed, 71
- in counters, 103104
- setting, 6970, 70
- using, 6668, 67, 69
- HTTP, HTML and, 5658, 56, 58
- HTTP servers and, 29
- MIME and, 5859, 59
- Perl and, 2628, 27, 28
- security and running CGI applications, 324
- World Wide Web and, 2629, 27, 28
- chdir function, 348
- child applications, 6970, 70
- chmod function, 348
- chomp function, 348349
- chop function, 231, 349
- chown function, 349
- chr function, 349
- chroot function, 349350
- close function, 9496, 350
- closedir function, 350
- comma (,) in file handle syntax, 101
- command line, 15
- commands. See also server-side includes
- UNIX commands, 8
- comments
- comment character (#) in Perl, 15, 18
- in hosts files, 6061
- in HTML, 189
- in Perl, 22
- Common Gateway Interface. See CGI
- Common Log Format, 219221, 220, 407. See also log files
- extracting information, 227231, 229
- making IIS logs compatible with, 221222, 222
- compiled languages, 1112
- compiling Perl source code, 14
- CompuServe GIF format, 205
- conditional statements, 104, 407
- foreach statements, 242243
- if statements
- in access counters, 104106
- in database searches, 293, 302
- in quiz forms, 154156
- last function, 367
- next function, 371
- for statements
- in guest book example, 179180
- in log file extraction example, 236238
- while statements, 7677
- in log file extraction example, 230
- read function in a while loop, 178179
- #config server-side includes directive, 191, 198200, 199
- configuring Windows NT Registry for HTTP servers, 4044, 41
- connect function, 350
- converting guest books into command-line searchable databases, 288293, 289, 292
- cos function, 350
- counters, 90110, 153154, 205212, 407. See also log files
- access counter example, 101110
- automating URLs with frames, 107109, 108, 109
- controlling what gets counted, 103104
- environment variables, 103104
- HTML and, 106107
- if statements, 104106
- making the access counter graphical, 206208, 209
- relational operators, 105106
- running the counter, 106107, 107
- wrappers, 101102, 103
- analyzing the problem, 9192, 92
- designing the solution, 9293, 93
- file manipulation and, 94101
- append operator (>>), 97, 98
- close function, 9496, 350
- file handles, 9697
- open function, 9496, 371372
- overview of file handling functions, 9495, 95
- print function, 9495, 99101
- read function, 9495, 100
- redirection operators (< >) for input and output, 9798
- write function, 9496, 100, 102, 395
- graphical access counter example, 205212
- local function, 209210, 369
- making the access counter example graphical, 206208, 209
- pipe function, 211, 374
- PostScript code, 209, 212
- print function GS parameter, 210
- program explanation, 209212
- variables, 210211
- implementing the solution, 93
- overview of, 9091, 90
- in quiz forms, 153154
- CPUs. See microprocessors
- creating
- database searches in HTML, 294297, 295, 298
- ender code files, 5152
- guest books, 162166, 163, 165
- Hello World script example, 15
- HTML code and displaying on Web servers, 4555
- creating ender code files, 5152
- creating HTML code, 4546
- extending subroutines with header files, 5354
- installing ender code files, 5253
- MIME headers, 4849
- print statements, 5051
- require function, 5055
- running, 47, 47
- subroutines, 4950, 50, 52
- underscore (_), 5455
- password files, 328330
- crypt function, 351
- csh command in UNIX, 8
- curly braces ({ }) in subroutines, 52
D
- daemons in UNIX, 42
- DARPA (Defense Advanced Research Project Agency), 399
- data, Parkinsons Law of, 274
- databases, 171, 288
- dbmclose function, 351
- dbmopen function, 351
- records, 288
- searching, 288303
- converting guest books into command-line searchable databases, 288293, 289, 292
- creating database searches in HTML, 294297, 295, 298
- searching on multiple fields, 298303, 300, 302
- wildcards in, 299, 301
- dates
- configuring display with server-side includes, 191, 198200, 199
- in UNIX Common Log Format, 221
- dbmclose function, 351
- dbmopen function, 351
- decoding
- log files, 217
- query strings in URLs, 120, 126127, 127
- Defense Advanced Research Project Agency (DARPA), 399
- defined function, 351
- delete function, 352
- deleting guest book entries, 336341, 339
- delimiters in markup languages, 252
- descriptive markup languages, 252253
- designing programs, 9293, 93
- die function, 170, 352, 407
- directives. See server-side includes
- directories
- chdir function, 348
- chroot function, 349350
- closedir function, 350
- mkdir function, 370
- opendir function, 372
- Perl directory functions, 239, 407
- readdir function, 377
- reading directories of log files, 238243, 239, 242
- rewinddir function, 239, 379
- rmdir function, 380
- seekdir function, 239, 381
- setting directory permissions, 321324, 322, 323
- telldir function, 239, 390
- write permission for users from the World Wide Web, 102
- displaying
- CGI environment variables in HTML documents, 7282
- display program explained, 7576
- each function, 7677, 353
- running the example, 7780, 78, 79
- sorting associative arrays, 8182, 82
- while statements, 7677
- writing the display program, 7275
- guest book entries, 174181
- the display program, 174177, 178, 179
- for statements, 179180
- localtime function, 180181, 369
- NULL characters, 77, 180, 410
- overview of, 174175
- read function in a while loop, 178179
- do function, 352
- document type definitions (DTDs), 253257, 407. See also SGML
- defining markup languages, 254257
- IETF (Internet Engineering Task Force) Level 2 and 3 DTDs, 253254
- Netscapes Mozilla DTD, 254
- dollar sign ($)
- global variable ($!), 170, 408
- in regular expressions, 132
- scalars and, 23, 97
- Domain Name Service (DNS), 60, 399
- domain names, 305
- registering, 398
- dot (.)
- directory notation in UNIX and Windows, 238
- in regular expressions, 132
- string concatenation operator, 226227
- double quote ()
- escaped double quote (||), 20
- in lists, 26
- downloading
- Ghostscript, 204205
- Perl, 13
- Perl script for emulating server-side includes, 190
- Sambar Web server, 39, 39
- DTDs. See document type definitions
- dump function, 353
- dynamic Web pages, 194
E
- each function, 7677, 353
- #echo server-side includes directive, 191, 194196, 195
- ed command in UNIX, 8
- elements in SGML, 254, 256
- else statements. See if statements
- emulating server-side includes, 190
- encoding
- printable characters in URLs, 121123, 410
- URLs with GET method, 124126, 126
- encrypted passwords, 326327, 328
- ender code files
- creating, 5152
- installing, 5253
- ending Perl scripts, 2021, 21
- environment variables, 30, 30, 6682, 103104, 407. See also CGI
- common variables listed, 71
- in counters, 103104
- displaying in HTML documents, 7282
- display program explained, 7576
- each function, 7677, 353
- running the example, 7780, 78, 79
- sorting associative arrays, 8182, 82
- while statements, 7677
- writing the display program, 7275
- setting, 6970, 70
- using, 6668, 67, 69
- eof function, 353354
- equal to operator (==), 105
- error message display configuration using server-side includes, 191, 198200, 199
- escaped characters, 1920
- European Laboratory for Particle Physics (CERN), 190, 400401, 406
- eval function, 354
- exclamation point (!)
- in comments, 18
- global variable ($!), 170, 408
- not equal to operator (!=), 105
- exec function, 354
- #exec server-side includes directive, 191, 196197, 320321
- exercises. See Sambar Web server
- exit function, 355
- exp function, 355
- expressions. See regular expressions
- extensions, 258263. See also HTML
- for applets, 260, 263
- for frames, 258259, 258, 259, 260263, 262
- external code, 51
- extracting log file information, 217219, 223231
- from IIS logs, 217219, 218
- with split function, 223227, 225
- from UNIX Common Log Format files, 227231, 229
F
- fcntl function, 355
- file handles, 9697, 407408
- getc function, 356357
- read function, 9495, 100, 376
- in quiz form example, 143145, 145
- in while loops, 178179
- stat function, 387
- STDIN (standard input), 143145, 145, 411
- tell function, 390
- truncate function, 391
- file name extensions
- .pl, 38
- .pm, 169
- File Transfer Protocol (FTP), 321
- fileno function, 355356
- files, 94101. See also log files; print function; read function
- append operator (>>), 97, 98
- close function, 9496, 350
- configuring file-size display with server-side includes, 191, 198200, 199
- creating password files, 328330
- eof function, 353354
- fcntl function, 355
- #fsize and #flastmod server-side includes directives for getting file statistics, 191, 197198, 408
- hosts files, 409
- comments in, 6061
- gethostbyaddr and gethostbyname functions, 308310, 357358
- IP addresses and, 6062, 61, 305306
- link function, 368
- open function, 9496, 371372
- overview of file handling functions, 9495, 95
- redirection operators (< >) for input and output, 9798
- rename function, 378
- setting file permissions, 321324, 322, 323
- unlink function, 392
- write function, 9496, 100, 102, 395
- filtering HTML code, shell commands, or URLs out of form input, 183184, 183, 184
- finding. See searching
- firewalls, 306, 408
- flags, 152, 408
- #flastmod server-side includes directive, 191, 197198, 408
- flock function, 356
- folders. See directories
- <FONT> tag in HTML, 253, 260
- for statements. See also conditional statements
- in guest book example, 179180
- in log file extraction example, 236238
- foreach statements, 242243
- fork function, 356
- forms, 114134. See also guest books
- example, 115118, 116
- GET method and, 117, 118119, 124126, 126
- input types, 117118, 409
- POST method and, 117, 118119
- quiz forms, 138145, 139. See also forms
- complex polling example, 146156, 149, 150
- counters, 153154
- examples, 138142, 139, 142
- GET method, 143
- if statements, 154156
- POST method, 143145, 145
- processing, 143, 145146, 156157
- read function, 143145, 145
- saving instructions, 144
- STDIN (standard input) file handle, 143145, 145, 411
- regular expressions, 9, 128133, 230231, 301, 346, 365, 380, 411
- asterisk (*) in, 132
- backslash (\) in, 132
- caret (^) in, 132
- components of, 131133
- difficulty of, 131
- dollar sign ($) in, 132
- hex function, 130131, 365
- in log file extraction example, 230231
- pack function, 130131, 170173, 373374
- parentheses ( ) in, 133
- /PATTERN/ operator, 346
- period character or dot (.) in, 132
- plus sign (+) in, 132
- quantifiers, 132
- question mark (?) in, 132
- special characters, 132133
- substitute operator (s), 130, 380
- translation function (tr), 128131, 129
- security issues, 181184
- filtering out HTML code, shell commands, or URLs, 183184, 183, 184
- obscenities, 182
- restricting the amount of input, 182
- submitting, 118120, 119, 120
- URLs in, 120127
- ampersand (&) in, 121, 124
- decoding query strings, 120, 126127, 127
- encoding printable characters in URLs, 121123, 410
- hexadecimal values in, 121, 123124
- percent sign (%) in, 121, 124
- plus sign (+) in, 124
- question mark (?) in, 121, 124
- URL encoding with GET method, 124126, 126
- forward slash (/) in UNIX, 15
- frames
- automating URLs with, 107109, 108, 109
- frame extension to HTML, 258259, 258, 259, 260263, 262
- Netscape Navigator versus Internet Explorer and, 258259, 258, 259
- Free Software Foundation (FSF), 201202, 408
- #fsize server-side includes directive, 191, 197198
- FTP (File Transfer Protocol), 321
G
- Gates, Bill, 279
- gateways, 29
- generating PostScript code with Ghostscript, 201204, 203
- GET method in HTML, 5758, 408
- encoding URLs with, 124126, 126
- in forms, 117, 118119
- in quiz forms, 143
- getc function, 356357
- getgrent function, 357
- gethostbyaddr function, 308310, 357
- gethostbyname function, 308310, 357358
- gethostent function, 358
- getlogin function, 358
- getnetbyaddr function, 358359
- getnetbyname function, 359
- getnetent function, 359
- getpeername function, 359
- getpgrp function, 359360
- getppid function, 360
- getpriority function, 360
- getprotobyname function, 360
- getprotobynumber function, 361
- getprotoent function, 361
- getpwent function, 361
- getpwnam function, 361362
- getpwuid function, 362
- getservbyname function, 362
- getservbyport function, 362
- getservent function, 362363
- getsocketname function, 363
- getsockopt function, 363
- Ghostscript, 201205, 408. See also graphical access counter
- downloading, 204205
- generating PostScript code, 201204, 203
- GIF format support, 205
- global variable ($!), 170, 408
- gmtime function, 363364
- goto function, 364365
- graphical access counter, 205212. See also counters; Ghostscript
- local function, 209210, 369
- making the access counter example graphical, 206208, 209
- pipe function, 211, 374
- PostScript code, 209, 212
- print function GS parameter, 210
- program explanation, 209212
- variables, 210211
- greater than operator (>), 105
- greater than or equal to operator (>=), 105
- grep command in UNIX, 8
- grep function, 365
- GS parameter for print function, 210
- guest books, 162185, 288293, 336341, 408. See also forms
- adding entries, 166168, 168, 169
- creating, 162166, 163, 165
- deleting entries, 336341, 339
- die function, 170, 352, 407
- displaying entries, 174181
- the display program, 174177, 178, 179
- for statements, 179180
- localtime function, 180181, 369
- NULL characters, 77, 180, 410
- overview of, 174175
- read function in a while loop, 178179
- logical OR operator (||), 170, 409
- pack function, 130131, 170173, 373374
- reading and writing structured data, 170171
- require function, 169170
- scalar variables, 169
- security issues, 181184
- filtering out HTML code, shell commands, or URLs, 183184, 183, 184
- obscenities, 182
- restricting the amount of input, 182
- time function, 174, 390
- unpack function, 170, 173174, 392
H
- handles. See file handles
- hardware for Web servers, 268274
- hard disk drives, 274
- memory, 272273
- microprocessors, 269272
- multiprocessor computers, 271, 273
- overview of, 268269
- hashing, 72, 408
- header files, extending subroutines with, 5354
- headers, MIME headers in Perl scripts, 4849
- Hello World script example, 1521
- creating, 15
- ending, 2021, 21
- newline character (||n), 19
- overview of, 12
- print function, 1819, 24, 45
- running, 1517, 16
- hellowww.pl example, 4555
- creating, 4546
- creating ender code files, 5152
- extending subroutines with header files, 5354
- installing ender code files, 5253
- MIME headers, 4849
- print statements, 5051
- require function, 5055
- running, 47, 47
- subroutines, 4950, 50, 52
- underscore (_), 5455
- here operator (<<), 296297
- hex function, 130131, 365
- hexadecimal values, 121, 123124, 408
- hit counters. See counters
- hosts files, 409
- comments in, 6061
- gethostbyaddr and gethostbyname functions, 308310, 357358
- IP addresses and, 6062, 61, 305306
- HTML forms. See forms
- HTML (Hypertext Markup Language), 4, 409. See also markup languages; SGML
- adding boilerplate to HTML documents with #include server-side includes directive, 191, 192194, 193
- CGI (Common Gateway Interface) and, 5658, 56, 58
- comments, 189
- creating database searches, 294297, 295, 298
- creating HTML code and displaying on Web servers, 4555
- creating ender code files, 5152
- creating HTML code, 4546
- extending subroutines with header files, 5354
- installing ender code files, 5253
- MIME headers, 4849
- print statements, 5051
- require function, 5055
- running, 47, 47
- subroutines, 4950, 50, 52
- underscore (_), 5455
- filtering HTML code out of form input, 183184, 183, 184
- <FONT> tag, 253, 260
- GET method, 5758, 408
- encoding URLs with, 124126, 126
- in forms, 117, 118119
- in quiz forms, 143
- history of, 257
- input types, 117118, 409
- limitations of, 2627
- Netscape extensions, 258263
- for applets, 260, 263
- for frames, 258259, 258, 259, 260263, 262
- POST method, 58, 410
- in forms, 117, 118119
- in quiz forms, 143145, 145
- SGML (Standard Generalized Markup Language) and, 250, 252253
- table width settings, 165
- <TEXTAREA> tag, 181182
- HTTP (Hypertext Transfer Protocol), 7, 7, 401, 409
- CGI (Common Gateway Interface) and, 5658, 56, 58
- Secure-HTTP (S-HTTP), 326, 411
- HTTP servers. See also Sambar Web server; Web servers
- browser communications with, 5657
- CGI and, 29
- log files, 217
- setting up, 3845
- configuring Windows NT Registry, 4044, 41
- downloading Sambar Web server, 39, 39
- Internet Information Server and, 4041
- overview of, 38
- running Sambar Web server on Windows 95 or NT, 39, 39
- on UNIX, 4445
I
- IETF (Internet Engineering Task Force) Level 2 and 3 document type definitions (DTDs), 253254
- if statements. See also conditional statements
- in access counters, 104106
- in database searches, 293, 302
- in quiz forms, 154156
- Image MIME type, 85
- implementing
- programs, 93
- Web page password-protection, 330334, 331, 332, 334
- #include directive in C and C++, 51
- #include server-side includes directive, 191, 192194, 193
- index function, 365
- initializing associative arrays, 7375
- input with redirection operators (< >), 9798
- input types in HTML, 117118, 409
- installing
- ender code files, 5253
- Internet Information Server, 40
- Perl interpreter, 1314
- int function, 365366
- Internet, 409. See also World Wide Web
- history of, 398403
- Defense Advanced Research Project Agency (DARPA), 399
- the explosion, 400
- online services and, 400
- World Wide Web, 400403, 402
- logging in to UNIX and Windows NT systems from, 317319, 318
- Internet Engineering Task Force (IETF) Level 2 and 3 document type definitions (DTDs), 253254
- Internet Explorer, 258259, 258, 259
- Internet Information Server (IIS)
- HTTP servers and, 4041
- IIS logs
- making compatible with UNIX Common Log Format, 221222, 222
- retrieving information from, 217219, 218
- storing, 217
- restricting access to Web server directories, 319320, 319, 320
- Internet ports, 57
- Internet programming, 303311
- Internet addresses, hosts files, firewalls and, 305306, 408
- resolving Internet addresses with Perl, 306311, 308
- TCP/IP networking functions, sockets libraries and, 303305
- uses for, 311
- Internet service providers (ISPs), 409
- maintaining Web sites on, 46
- InterNIC, 398
- interpreted languages, 1112
- interprocess communication (IPC), 70
- intruders. See security
- ioctl function, 366
- IP addresses, 409. See also addresses
- and controlling counters, 103106
- hosts files and, 6062, 61, 305306
- in log files, 219, 235
- programming for, 305306
- resolving with Perl, 306311, 308
- IPC (interprocess communication), 70
- ISPs. See Internet service providers
J
- Java, 45, 409
- Java applets, 5, 406
- applet extension to HTML, 260, 263
- JavaScript, 56, 6
- as a CGI language, 34
- join function, 366
K
- keys function, 76, 366367
- kill function, 367
- ksh command in UNIX, 8
L
- languages. See also HTML; Perl; SGML
- C and C++ languages, 406
- argv lists, 293
- as CGI programming languages, 3132, 31
- #include directive, 51
- UNIX and C language, 910, 10
- CGI programming languages, 3134
- ActiveX controls, 34
- C and C++, 3132, 31
- JavaScript, 56, 6, 34
- proprietary CGI methods, 34
- shell scripts, 3334
- Visual Basic, 3233, 33
- compiled versus interpreted languages, 1112
- Java, 45, 409
- markup languages, 250252, 251
- defining in document type def-initions (DTDs), 254257
- descriptive markup languages, 252253
- procedural markup languages, 252
- metalanguages, 250
- proprietary languages, 56, 6
- Visual Basic Script, 56, 6
- last function, 367
- Law of Data, Parkinsons, 274
- lc function, 367368
- lcfirst function, 368
- length function, 368
- less than operator (<), 105
- less than or equal to operator (<=), 105
- link function, 368
- linking regular expressions with logical AND operator (&&), 301
- Linux operating system, 270
- listen function, 368369
- lists, 22, 2426, 293, 409
- ARGV lists, 293
- double quote () and single quote () in, 26
- naming, 24
- at sign (@) in, 2425
- strings in, 2526
- syntax of, 2425
- local function, 209210, 369
- localtime function, 180181, 369
- log files, 216245
- decoding, 217
- extracting information, 217219, 223231
- from IIS logs, 217219, 218
- with split function, 223227, 225
- from UNIX Common Log Format files, 227231, 229
- HTTPD server logs, 217
- IIS logs
- extracting information from, 217219, 218
- making compatible with UNIX Common Log Format, 221222, 222
- storing, 217
- IP addresses in, 219, 235
- for monitoring Web page activity, 231245
- counting who accesses your Web page and how often, 232238, 234
- overview of, 231232
- putting access counters in Web pages, 244245, 245
- reading directories of log files, 238243, 239, 242
- NCSA server logs, 217, 221
- Sambar server logs, 217
- UNIX Common Log Format, 219221, 220
- extracting information, 227231, 229
- making IIS logs compatible with, 221222, 222
- log function, 369
- logging in to UNIX and Windows NT systems from the Internet, 317319, 318
- logical AND operator (&&), 301, 409
- logical OR operator (||), 155, 170, 409
- loopback addresses, 61
- lowercase. See case
- lstat function, 370
M
- man command in UNIX, 8
- map function, 370
- markup languages, 250252, 251. See also HTML; SGML
- defining in document type definitions (DTDs), 254257
- descriptive markup languages, 252253
- procedural markup languages, 252
- memory
- bus architecture and, 273
- dump function, 353
- virtual memory, 272
- Web server requirements, 272273
- message display configuration using server-side includes, 191, 198200, 199
- Message MIME type, 85
- metalanguages, 250
- microprocessors
- Moores Law, 270
- multiprocessor computers, 271, 273
- Web server requirements, 269272
- Microsoft Internet Explorer, 258259, 258, 259
- Microsoft Windows 95
- multitasking, 69, 271, 410
- running Sambar Web server on, 39, 39
- security, 281282
- as a Web server operating system, 271, 274, 277, 281282
- as Web server software, 284
- Microsoft Windows NT
- configuring Registry for HTTP servers, 4044, 41
- logging in to Windows NT systems from the Internet, 317319, 318
- logon passwords, 318319
- mounting remote shared volumes, 318
- multitasking, 69, 271, 410
- restricting access to Web server directories, 319320, 319, 320
- running Sambar Web server on, 39, 39
- security, 280281
- services, 42
- setting file and directory permissions, 321324, 323
- taking ownership, 322
- versus UNIX, 279
- as a Web server operating system, 270271, 274, 277, 278281, 280
- as Web server software, 284
- Microsoft Windows NT Server, overview of, 279280
- Microsoft Windows NT Workstation
- connection restrictions, 273
- overview of, 279280
- MIME (Multipurpose Internet Mail Extensions), 45, 410
- CGI (Common Gateway Interface) and, 5859, 59
- MIME headers in Perl scripts, 4849
- MIME types, 8285
- Application type, 83
- Audio and Video types, 84
- Image type, 85
- Message type, 85
- Multipart type, 85, 86
- Text type, 85
- MIME-encoded files, 84
- mkdir function, 370
- Moores Law, 270
- mounting remote shared Windows NT volumes, 318
- Mozilla document type definitions (DTDs), 254
- msgctl, msgget, msgrcv, and msgsnd functions, 370
- Multipart MIME type, 85, 86
- multiprocessor computers, 271, 273
- multitasking, 69, 271, 410
- my function, 370371
N
- naming lists, 24
- NCSA servers, 410. See also Web servers
- log files, 217, 221
- Web server software, 283
- Netscape
- extensions, 258263
- for applets, 260, 263
- for frames, 258259, 258, 259, 260263, 262
- Mozilla document type definitions (DTDs), 254
- Netscape Navigator versus Internet Explorer, 258259, 258, 259
- Secure Sockets Layer (SSL), 324326, 325, 411
- newline character (||n), 19
- next function, 371
- NOBR Netscape HTML extension, 260
- not equal to operators (!= or <=>), 105
- NULL values, 77, 180, 410
- number sign (#)
- as comment character in hosts files, 6061
- as comment character in Perl, 15, 18
- in server-side includes directives, 189
- numbers in strings, 68
O
- obscenities in form input, 182
- oct function, 371
- online services, 400
- open function, 9496, 371372
- opendir function, 372
- operating systems for Web servers, 274282, 410. See also Microsoft Windows; UNIX
- Linux, 270
- overview of, 274275
- UNIX, 269270, 274, 275278, 276
- Windows 95, 271, 274, 277, 281282
- Windows NT, 270271, 274, 277, 278281, 280
- operators
- arithmetic operators, 99
- here operator (<<), 296297
- logical OR operator (||), 155, 170, 409
- /PATTERN/ operator, 346
- relational operators, 105106
- substitute operator (s), 130, 380
- translation operator (tr), 128131, 129, 391
- OR operator (||), 155, 170
- ord function, 372
- output with redirection operators (< >), 9798
P
- pack function, 130131, 170173, 373374
- parameters, 18
- parent applications, 6970, 70
- parentheses ( )
- in regular expressions, 133
- in while statements, 77
- Parkinsons Law of Data, 274
- passwords. See also security
- getpwent function, 361
- getpwnam function, 361362
- getpwuid function, 362
- password-protecting Web pages, 326335
- creating password files, 328330
- implementing password-protection, 330334, 331, 332, 334
- reading and writing encrypted passwords, 326327, 328
- uses for, 334335, 335
- /PATTERN/ operator, 346
- percent sign (%)
- in associative arrays, 72
- in URLs, 121, 124
- period (.)
- directory notation in UNIX and Windows, 238
- in regular expressions, 132
- string concatenation operator, 226227
- Perl, 4, 89, 410
- case sensitivity in, 23
- CGI (Common Gateway Interface) and, 2628, 27, 28
- compiling Perl source code, 14
- downloading, 13
- history of, 810, 10, 11
- HTTP and, 7, 7
- as an interpreted language, 1112
- Perl interpreter, 1315
- installing, 1314
- starting, 1415
- regular expressions, 9
- special characters, 1920
- UNIX and, 610, 10, 11
- World Wide Web and, 2628, 28
- Perl scripts, 12, 13
- for emulating server-side includes, 190
- Hello World example, 1521
- creating, 15
- ending, 2021, 21
- newline character (||n), 19
- overview of, 12
- print function, 1819, 24, 45
- running, 1517, 16
- hellowww.pl example, 4555
- creating, 4546
- creating ender code files, 5152
- extending subroutines with header files, 5354
- installing ender code files, 5253
- MIME headers, 4849
- print statements, 5051
- require function, 5055
- running, 47, 47
- subroutines, 4950, 50, 52
- underscore (_), 5455
- how Perl scripts run, 1617, 17
- personalizing Web pages to visitors, 191, 194196, 195
- pipe function, 211, 374
- .pl files, 38
- plus sign (+)
- in regular expressions, 132
- in URLs, 124
- .pm files, 169
- polling. See quiz forms
- pop function, 374
- ports, Internet ports, 57
- POST method in HTML, 58, 410
- in forms, 117, 118119
- in quiz forms, 143145, 145
- PostScript code
- generating with Ghostscript, 201204, 203
- in graphical access counter, 209, 212
- pound sign (#)
- as comment character in hosts files, 6061
- as comment character in Perl, 15, 18
- in server-side includes directives, 189
- print function, 375
- in cgienv.pl example, 80
- in database searches, 297
- for files, 9495, 99101
- GS parameter, 210
- in hellowww.pl example, 5051
- printf function, 375376
- printing to the screen, 1819, 24, 45
- printing to Web servers in HTML, 4549, 47
- sprintf function, 386
- printable characters in URLs, 121123, 410
- procedural markup languages, 252
- processing quiz forms, 143, 145146, 156157
- processors. See microprocessors
- programming languages. See languages
- proprietary CGI methods, 34
- proprietary languages, 56, 6
- protocols
- FTP (File Transfer Protocol), 321
- getprotobyname function, 360
- getprotobynumber function, 361
- getprotoent function, 361
- HTTP (Hypertext Transfer Protocol), 7, 7, 401, 409
- CGI (Common Gateway Interface) and, 5658, 56, 58
- Secure-HTTP (S-HTTP), 326, 411
- TCP/IP, 411
- history of, 399
- hosts files and, 6062, 61
- networking functions, 303305
- Telnet, 321
- push function, 376
Q
- quantifiers in regular expressions, 132
- query strings in URLs, 120, 126127, 127
- question mark (?)
- in regular expressions, 132
- in URLs, 121, 124
- quiz forms, 138145, 139. See also forms
- complex polling example, 146156, 149, 150
- counters, 153154
- examples, 138142, 139, 142
- GET method, 143
- if statements, 154156
- POST method, 143145, 145
- processing, 143, 145146, 156157
- read function, 143145, 145
- saving instructions, 144
- STDIN (standard input) file handle, 143145, 145, 411
- quotation marks. See double quote; single quote
R
- rand function, 376
- read function, 9495, 100, 376
- in quiz form example, 143145, 145
- in while loops, 178179
- readdir function, 377
- reading
- encrypted passwords, 326327, 328
- structured data, 170171
- readlink function, 377
- records, 288
- recv function, 377
- redirection operators (< >), 9798
- registering domain names, 398
- regular expressions, 9, 128133, 230231, 301, 346, 365, 380, 411
- asterisk (*) in, 132
- backslash (\) in, 132
- caret (^) in, 132
- components of, 131133
- difficulty of, 131
- dollar sign ($) in, 132
- hex function, 130131, 365
- linking with logical AND operator (&&), 301
- in log file extraction example, 230231
- pack expression, 130131, 170173, 373374
- parentheses ( ) in, 133
- /PATTERN/ operator, 346
- period character or dot (.) in, 132
- plus sign (+) in, 132
- quantifiers, 132
- question mark (?) in, 132
- special characters, 132133
- substitute operator (s), 130, 380
- translation function (tr), 128131, 129
- relational operators, 105106
- rename function, 378
- require function, 378
- in cgienv.pl example, 7576, 78
- in guest book program, 169170
- in hellowww.pl example, 5055
- reset function, 378
- resolving Internet addresses with Perl, 306311, 308
- restricting
- access to Web server directories, 319320, 319, 320
- the amount of input into forms, 182
- return function, 378379
- return-value convention, 79
- reverse function, 379
- rewinddir function, 239, 379
- Rich Text Format, 251252, 251
- rindex function, 379
- rmdir function, 380
- running
- CGI applications, 324
- Hello World script example, 1517, 16
- hellowww.pl example, 47, 47
- Perl scripts, 1617, 17
- programs on Web servers with #exec server-side includes directive, 191, 196197, 320321
- Sambar Web server on Windows 95 or NT, 39, 39
S
- s (substitution operator), 130, 380
- Sambar Web server, 39, 6063, 411. See also Web servers
- downloading, 39, 39
- exercises
- counters, 110, 246
- creating home pages, 8687
- creating links, 285
- database searches, 312
- forms, 133
- frames, 110, 264
- graphical counters, 213
- guest book, 185
- log files, 246
- opening Sambar server Web page, 6263
- quiz forms, 157
- server-side includes, 213
- Web site security, 343
- log files, 217, 246
- restricting access to Web server directories, 319320, 319, 320
- running on Windows 95 or NT, 39, 39, 62
- security, 282
- TCP/IP protocol, hosts files and, 6062, 61
- on Windows 95 and NT, 284
- scalars, 2224, 23, 411. See also variables
- dollar sign ($) and, 23, 97
- in guest books, 169
- scalar function, 380
- SCRIPT Netscape HTML extension, 260
- scripts. See Perl scripts
- searching
- databases, 288303
- converting guest books into command-line searchable databases, 288293, 289, 292
- creating database searches in HTML, 294297, 295, 298
- searching on multiple fields, 298303, 300, 302
- wildcards in, 299, 301
- for security holes in your system, 316317
- Secure Sockets Layer (SSL), 324326, 325, 411
- Secure-HTTP (S-HTTP), 326, 411
- security, 181184, 280282, 306, 316343
- finding security holes in your system, 316317
- firewalls, 306, 408
- in forms, 181184
- filtering out HTML code, shell commands, or URLs, 183184, 183, 184
- obscenities, 182
- restricting the amount of input, 182
- FTP, Telnet and, 321
- logging in to UNIX and Windows NT systems from the Internet, 317319, 318
- password-protecting Web pages, 326335
- creating password files, 328330
- implementing password-protection, 330334, 331, 332, 334
- reading and writing encrypted passwords, 326327, 328
- uses for, 334335, 335
- passwords
- getpwent function, 361
- getpwnam function, 361362
- getpwuid function, 362
- restricting access to Web server directories, 319320, 319, 320
- running CGI applications, 324
- in Sambar Web server, 282
- Secure Sockets Layer (SSL), 324326, 325, 411
- Secure-HTTP (S-HTTP), 326, 411
- server-side includes #exec directive system calls and, 320321
- setting file and directory permissions, 321324, 322, 323
- Web site security, 335343
- creating a maintenance tool from guest book editor program, 341343
- deleting guest book entries, 336341, 339
- overview of, 335336
- in Windows 95, 281282
- in Windows NT, 280281
- sed command in UNIX, 8, 9
- seek function, 380381
- seekdir function, 239, 381
- select function, 381
- selecting
- hardware for Web servers, 268274
- hard disk drives, 274
- memory, 272273
- microprocessors, 269272
- multiprocessor computers, 271, 273
- overview of, 268269
- operating systems for Web servers, 274282
- Linux, 270
- operating systems defined, 410
- overview of, 274275
- UNIX, 269270, 274, 275278, 276
- Windows 95, 271, 274, 277, 281282
- Windows NT, 270271, 274, 277, 278281, 280
- Web browsers to support, 282, 284
- Web server software, 282284
- overview of, 282283
- UNIX Apache servers, 283, 406
- UNIX NCSA servers, 217, 221, 283, 410
- Windows NT and 95 servers, 284
- semctl, semget, and semop functions, 382
- semicolon (;) in Perl, 19
- send function, 382
- servers. See Web servers
- server-side includes (SSI), 188199, 411
- #config directives for date and time, file-size statistics, and error message display, 191, 198200, 199
- directives listed, 191
- #echo directive for personalizing Web pages to visitors, 191, 194196, 195
- #exec directive for running programs on Web servers, 191, 196197, 320321
- #fsize and #flastmod directives for getting file statistics, 191, 197198, 408
- #include directive for adding boilerplate to HTML documents, 191, 192194, 193
- Perl script for emulating server-side includes, 190
- Web servers and, 191192, 192
- services
- getservbyname function, 362
- getservbyport function, 362
- getservent function, 362363
- in Windows NT, 42
- setpgrp function, 382
- setpriority function, 382383
- setsockopt function, 383
- setting file and directory permissions, 321324, 322, 323
- setting up HTTP servers, 3845. See also Web servers
- configuring Windows NT Registry, 4044, 41
- downloading Sambar Web server, 39, 39
- Internet Information Server and, 4041
- overview of, 38
- running Sambar Web server on Windows 95 or NT, 39, 39
- on UNIX, 4445
- SGML (Standard Generalized Markup Language), 250257, 411
- descriptive markup languages and, 252253
- document type definitions (DTDs), 253257, 407
- defining markup languages, 254257
- IETF (Internet Engineering Task Force) Level 2 and 3 DTDs, 253254
- Netscapes Mozilla DTD, 254
- elements, 254, 256
- HTML and, 250, 252253
- markup languages explained, 250252, 251
- sh command in UNIX, 8
- shell commands, filtering out of form input, 183184, 183, 184
- shell scripts for CGI programming, 3334
- shift function, 383
- shmctl, shmget, shmread, and shmwrite functions, 383
- S-HTTP protocol, 326, 411
- shutdown function, 383384
- sin function, 384
- single quote () in lists, 26
- slash (/) in UNIX, 15
- sleep function, 384
- sockets
- accept function, 346
- bind function, 347
- close function, 9496, 350
- connect function, 350
- getpeername function, 359
- getsocketname function, 363
- getsockopt function, 363
- listen function, 368369
- recv function, 377
- Secure Sockets Layer (SSL), 324326, 325, 411
- send function, 382
- setsockopt function, 383
- shutdown function, 383384
- socket function, 384385
- socketpair function, 385
- sockets libraries, 303305
- sort function, 8182, 82, 385
- special characters. See also Symbols section of the index
- in Perl, 1920
- in regular expressions, 132133
- splice function, 385386
- split function, 386
- decoding URL query strings, 126127
- extracting log file information, 223227, 225
- sprintf function, 386
- sqrt function, 386
- srand function, 386387
- SSI. See server-side includes
- SSL (Secure Sockets Layer), 324326, 325, 411
- standard input (STDIN) file handle, 143145, 145, 411
- standard output (stdout), 1617, 17, 45, 99, 411
- starting Perl interpreter, 1415
- stat function, 387
- STDIN (standard input) file handle, 143145, 145, 411
- strings, 18, 22
- in lists, 2526
- numbers in, 68
- string concatenation operator (.), 226227
- study function, 388
- submitting forms, 118120, 119, 120
- subroutines, 4950, 50
- extending with header files, 5354
- in hellowww.pl example, 52
- substitute operator (s), 130, 380
- substr function, 388
- super-users in UNIX, 318
- symbols. See special characters; Symbols section of the index
- symlink function, 388
- syntax of lists, 2425
- syscall function, 388389
- sysread function, 389
- system function, 389
- systems, 91
- syswrite function, 389390
T
- table width settings, 165
- TCP/IP protocol, 411. See also protocols
- history of, 399
- hosts files and, 6062, 61
- networking functions, 303305
- tell function, 390
- telldir function, 239, 390
- Telnet program, 321
- template formats for pack function, 170173
- terminating conditions, 179
- text. See strings
- Text MIME type, 85
- <TEXTAREA> tag in HTML, 181182
- time
- configuring display with server-side includes, 191, 198200, 199
- gmtime function, 363364
- localtime function, 180181, 369
- time function, 174, 390
- times function, 391
- in UNIX Common Log Format, 221
- utime function, 393
- tools, 54
- translation operator (tr), 128131, 129, 391
- truncate function, 391
U
- umask function, 391392
- undef function, 392
- underscore (_) in Perl, 5455
- UNIX, 78
- Apache Web server software, 283, 406
- BSD (Berkeley Systems Development) UNIX, 303304
- C language and, 910, 10
- commands and utilities, 8
- Common Log Format, 219221, 220, 407. See also log files
- extracting information, 227231, 229
- making IIS logs compatible with, 221222, 222
- daemons, 42
- forward slash (/) in, 15
- httpd.conf files, 45
- logging in to UNIX systems from the Internet, 317319, 318
- logon passwords, 318319
- multitasking, 69, 271, 410
- NCSA Web server software, 217, 221, 283, 410
- Perl and, 610, 10, 11
- regular expressions, 9
- restricting access to Web server directories, 319320, 319, 320
- setting file and directory permissions, 321324, 322, 323
- setting up HTTP servers on, 4445
- sockets library, 303305
- srm.conf files, 44
- super-users, 318
- as a Web server operating system, 269270, 274, 275278, 276
- versus Windows NT, 279
- X-Windows interface, 276
- unlink function, 392
- unpack function, 170, 173174, 392
- unshift function, 392393
- uppercase. See case
- URLs (Uniform Resource Locators), 47, 120121, 121, 411
- automating with frames, 107109, 108, 109
- filtering out of form input, 183184, 183, 184
- in forms, 120127
- ampersand (&) in, 121, 124
- decoding query strings, 120, 126127, 127
- encoding printable characters in URLs, 121123, 410
- hexadecimal values in, 121, 123124
- percent sign (%) in, 121, 124
- plus sign (+) in, 124
- question mark (?) in, 121, 124
- URL encoding with GET method, 124126, 126
- utilities in UNIX, 8
- utime function, 393
V
- values function, 76, 393
- variables, 411
- CGI environment variables, 30, 6682, 103104, 407
- common variables listed, 71
- in counters, 103104
- displaying in HTML documents, 7282
- setting, 6970, 70
- using, 6668, 67, 69
- displaying CGI environment variables in HTML documents, 7282
- display program explained, 7576
- each function, 7677, 353
- running the example, 7780, 78, 79
- sorting associative arrays, 8182, 82
- while statements, 7677
- writing the display program, 7275
- global variable ($!), 170, 408
- in graphical access counter, 210211
- local function, 209210, 369
- my function, 370371
- in Perl, 2122
- reset function, 378
- scalars, 2224, 23, 411
- dollar sign ($) and, 23, 97
- in guest books, 169
- scalar function, 380
- vec function, 393
- vi command in UNIX, 8
- Video MIME type, 84
- virtual memory, 272
- Visual Basic, 3233, 33
- Visual Basic Script, 56, 6
- volumes, mounting remote shared Windows NT volumes, 318
W
- wait function, 394
- waitpid function, 394
- Wall, Larry, 8, 49, 101, 152
- wantarray function, 394
- warn function, 394395
- WBR Netscape HTML extension, 260
- Web browsers, 401403, 402, 406. See also World Wide Web
- communications with HTTP servers, 5657
- deciding which to support, 282, 284
- Java applets and, 5
- Web pages. See also Web sites
- dynamic Web pages, 194
- monitoring activity, 231245
- counting who accesses your Web page and how often, 232238, 234
- overview of, 231232
- putting access counters in Web pages, 244245, 245
- reading directories of log files, 238243, 239, 242
- password-protecting, 326335
- creating password files, 328330
- implementing password-protection, 330334, 331, 332, 334
- reading and writing encrypted passwords, 326327, 328
- uses for, 334335, 335
- personalizing to visitors, 194196, 195
- Web servers, 268285. See also HTTP servers; log files; Sambar Web server
- creating HTML code and displaying on, 4555
- creating ender code files, 5152
- creating HTML code, 4546
- extending subroutines with header files, 5354
- installing ender code files, 5253
- MIME headers, 4849
- print statements, 5051
- require function, 5055
- running, 47, 47
- subroutines, 4950, 50, 52
- underscore (_), 5455
- HTTP server setup, 3845
- configuring Windows NT Registry, 4044, 41
- downloading Sambar Web server, 39, 39
- Internet Information Server and, 4041
- overview of, 38
- running Sambar Web server on Windows 95 or NT, 39, 39
- on UNIX, 4445
- HTTP servers
- browser communications with, 5657
- CGI and, 29
- log files, 217
- NCSA servers, 410
- log files, 217, 221
- Web server software, 283
- restricting access to directories, 319320, 319, 320
- running programs on with #exec server-side includes directive, 191, 196197, 320321
- selecting hardware, 268274
- hard disk drives, 274
- memory, 272273
- microprocessors, 269272
- multiprocessor computers, 271, 273
- overview of, 268269
- selecting operating systems, 274282
- Linux, 270
- operating systems defined, 410
- overview of, 274275
- UNIX, 269270, 274, 275278, 276
- Windows 95, 271, 274, 277, 281282
- Windows NT, 270271, 274, 277, 278281, 280
- selecting Web server software, 282284
- overview of, 282283
- UNIX Apache servers, 283, 406
- UNIX NCSA servers, 217, 221, 283, 410
- Windows NT and 95 servers, 284
- server-side includes (SSI) and, 191192, 192
- supporting Web browsers, 282, 284
- Web sites. See also Web pages
- on Internet service providers, 46
- security, 335343
- creating a maintenance tool from guest book editor program, 341343
- deleting guest book entries, 336341, 339
- overview of, 335336
- whereis command in UNIX, 8
- while statements, 7677. See also conditional statements
- in log file extraction example, 230
- read function in a while loop, 178179
- wildcards in database searches, 299, 301
- Winsock API, 304305, 412
- World Wide Web, 412. See also Internet; Web browsers
- history of, 400403
- Perl, CGI (Common Gateway Interface) and, 2629, 27, 28
- wrappers, 101102, 103
- write function, 9496, 100, 102, 395
- writing
- encrypted passwords, 326327, 328
- structured data, 170171
X
- X-Windows interface for UNIX, 276
|