pack geometry manager, graphical phonebook application, 364–365
padx attribute, grid method, 88
pady attribute, grid method, 88
page
view_all.cgi, 187
view_item.cgi, 195
Page_Header function
index.cgi, 186
SmallAuction.pm, 206
view_all.cgi, 190
view_item.cgi, 198
Page_Print function, view_all.cgi, 195
param function
cart.cgi, 406
catalog.cgi (shopping cart program), 398
item_details.cgi (product catalog), 312
item_details.cgi (shopping cart program), 402
phonebook.cgi, 118–119
report_html.pl, 328
score_test.cgi, 148
signup.cgi, 248
take_test.cgi, 142
view_item.cgi, 196
parse method, soap_server.cgi, 306
password, data source name, 21
password type, <input> tag, 107
PATH environment variable
index.cgi, 186
view_all.cgi, 188–189
view_item.cgi, 197
percent (%), SQL wildcard, 120
period (.)
concatenation operator, 70
current directory, 184
regular expression, 203
Perl
add-ons, 113
database, connecting to, 19–20
database driver, checking availability, 17–18
diagnostic messages, debugging, 17
downloading from Web site, 37
Linux and Unix installation, 486–487
taint mode, 111–113
Windows installation, 482–486
Perl Package Manager (PPM), 483
Perl program listing
add_table.pl, 35
connect_multi.pl, 25–26
generate.pl, 459–462
photo_dumper.pl, 296–298
report_graphic.pl, 341–343
report_html.pl, 339–341
report_text.pl, 338–339
transaction.pl, 283
perl -v command, 487
perl.apache.org, 114
perldoc command, 113, 210, 328
Perl-enabled HTML tools, 114
perlreftut man page, 40
perlsec, Perl document, 113
permission, database, 21
Person form, graphical phonebook application, 371, 375, 377
person table, 348, 350
$person_add_b button declaration, graphical phonebook application, 361
Pg. See PostGreSQL
Phone form, graphical phonebook application, 372
phone list-box entry, graphical phonebook application, 371
phone number lookup program, command-line
DBI module, 356
die function, 356
disconnect function, 359
here document, 357
name validation, 357
overview, 356
prepare function, 358
quote function, 357
SELECT statement, 357
shift function, 356
strict module, 356
phone table, 348
PHONE type, 203
phonebook application, graphical
add_upd_person subroutine, 374
add_upd_phone subroutine, 374
anonymous subroutine declaration, 363
bind actions, 365
buttons, 360
chk_del_person subroutine, 362, 378
chk_del_phone subroutine, 364, 378
Close button, creating, 370
Delete Confirmation window, 379
fill_person_list subroutine, 361–362
fill_phone_list subroutine, 364
fill_pr_list subroutine, 373, 376
frames, 361
get method, 374
get_person_id subroutine, 378
global variables, 359–360
INSERT INTO statement, 375, 377
insert method, 373
list boxes, 360
Main program form, 368
MainLoop function, 360, 367
map function, 373
messageBox method, 378
new top-level window, creating, 359
overview, 359
pack geometry manager, 364–365
Person form, 371, 375, 377
$person_add_b button declaration, 361
Phone form, 372
phone list-box entry, 371
rollback, 379
Scrolled constructor, 360
shift function, 378
show_main_form subroutine, 360, 367
show_person_form subroutine, 361, 366, 368
show_phone_form subroutine, 363, 373
sprintf function, 373
text-entry fields, creating, 370
Tk module, 359
transactions, 379
update function, 367
UPDATE statement, 377
phonebook program, command-line
add_person subroutine, 351, 353
add_phone subroutine, 355
DBI module, 349
disconnect function, 350
execute function, 354
get_person_id subroutine, 351
global variables, 349
hash-slice, 353
input_person subroutine, 351
input_phone subroutine, 354
INSERT statement, 350, 353
map function, 353
output, 355
overview, 348–349
person table, 350
primary key, 355
$Query_statement variable, 352
reinputting required fields, 355
SELECT statement, 352
strict module, 349
phonebook.cgi
Add_Record subroutine, 118, 123
bind_columns method, 121–122
CGI module, 118
CGI::Carp module, 118
CGI.pm module, 118
$DB_Handle, 118
Display_Page subroutine, 124
Display_Results subroutine, 120–121
exit function, 126
fatalsToBrowser method, 117
Handle_DB_Error subroutine, 124
header function, 118
here document, 121
hidden field, 118
join function, 120
map function, 119
No_Data subroutine, 122–123
param function, 118–119
prepare method, 120
Search_DB subroutine, 118–119
SQL statement, generating, 120
strict module, 118
taint mode, 117
undef, 121–122
photo album application
Add_Album subroutine, 429
album table, 446
BasicSession module, 442
CGI module, 442
connect function, 429
DBI module, 427, 442
die function, 429
dim function, 427
fetch function, 453
fetchrow_array function, 449
fetchrow_hashref function, 446, 452
File::Copy module, 427
File::Find module, 427
find function, 429
Get_Details subroutine, 450
get_image function, 447
get_image subroutine, 453
Get_Photo_List subroutine, 448, 450
Get_Session function, 442
image metadata, writing to JPEG file, 429
image_info function, 427
Image::Info module, 427
Imager module, 427
lib module, 442
List_Albums subroutine, 444
Make_Sizes subroutine, 443–444
mkdir function, 429
output, 438–441, 455–456
overview, 425–426, 454
photo album files, absolute path, 428
photo table, 446
prepare method, 448
Print_Page subroutine, 445, 448
SELECT statement, 446, 451
shift function, 429, 450
Show_Album subroutine, 444, 446, 458–459
Show_Photo subroutine, 443
strict module, 427, 442
taint switch, 427
unshift function, 450
UPDATE statement, 457
Update_Data subroutine, 457
Wanted subroutine, 429
warning switch, 427
photo table, index.cgi (photo album program), 446
photo_dumper.pl
DBI module, 288
Do_SubTable subroutine, 290
end_tag subroutine, 289–290
execute method, 291
fetchrow_array method, 291
Gen_Output function, 289
Get_Keys function, 289–291
overview, 287
prepare method, 292
Print_Data function, 289–290, 292
program listing, 296–298
start_tag subroutine, 289
strict module, 288
warning switch, 288
XML header tag, 289
XML output example, 295
xml_esc subroutine, 294
xml_esc_name subroutine, 293
photo_main.tmpl, program listing, 478–479
pixel image, 240
placeholder, 156, 163, 210
+ (plus sign), regular expressions, 57, 203
port number, data source name, 21
port 3306, default MySQL port, 21
portable code, 19
post method, 106
PostGreSQL (Pg)
connecting to database, 21
data source name, specifying, 20
database driver, 18
sequence generator, 354
PPM. See Perl Package Manager
prefix, column name, 5
prepare function, command-line phone number lookup program, 358
prepare method
importance of, 22, 34
index.cgi (photo album program), 448
phonebook.cgi, 120
photo_dumper.pl, 292
Quizzer.pm, 162
SmallAuction.pm, 208
syntax, 519–520
primary key, command-line phonebook program, 355
Print_Data function, photo_dumper.pl, 289–290, 292
PrintError attribute, 24
Print_Page function
BasicSession.pm, 265
cart.cgi, 407–408
catalog.cgi (shopping cart program), 398–399
index.cgi (auction program), 187
index.cgi (photo album program), 445, 448
index.cgi (user registration program), 256
item_details.cgi (shopping cart program), 403
SmallAuction.pm, 205
view_all.cgi, 190
view_item.cgi, 200
private subroutine, 151
process ID, 264
product page, item_details.cgi, 311
production code, turning off warnings in, 17
products table, 30
program listing
add_questions.cgi, 169–171
add_table.pl, 35
admin.cgi, 466–470
auction_up.cgi, 241–242
cart.cgi (shopping cart program), 415–417
catalog.cgi (product catalog program), 317
catalog.cgi (shopping cart program), 413–414
command-line phone number lookup program, 383–384
command-line phonebook program, 380–383
comprehensive example, 97–101
connect_multi.pl, 25–26
create_test.cgi, 171–172
database tables, Quizzer application, 168
display_image.cgi, 243–244
generate.pl, 459–462
graphical phonebook program, 384–393
index.cgi (auction program), 217
index.cgi (photo album program), 463–466
item_detail.cgi (product catalog program), 318–319
item_details.cgi (shopping cart program), 415
MySQL tables, auction application, 215–217
photo_dumper.pl, 296–298
Quizzer.pm, 176–180
report_graphic.pl, 341–343
report_html.pl, 339–341
report_text.pl, 338–339
score_test.cgi, 172–173
SELECT statement, 59–66
signup.cgi, 267–268
simple add, 94–95
simple delete, 97
simple update, 95–96
SmallAuction.pm, 223–226
soap_server.cgi, 315–316
take_test.cgi, 173–175
test_chooser.cgi, 175–176
transaction.pl, 283
upload.cgi, 242–243
view_all.cgi, 217–220
view_item.cgi, 220–223
Web phonebook application, 165–168
programs, isolating from data storage, 3
PROJECT operation, SELECT statement, 7
Proxy database driver, 18
public subroutine, 151
publisher field, 43, 47
push function, SmallAuction.pm, 212