Cover image for Perl power! : a jumpstart guide to programming in Perl 5
Title:
Perl power! : a jumpstart guide to programming in Perl 5
Author:
Schilli, Michael.
Personal Author:
Publication Information:
Harlow, England ; Reading, Mass. : Addison Wesley, 1999.
Physical Description:
xv, 438 pages : illustrations ; 24 cm + 1 computer laser optical disc (4 3/4 in.)
Language:
English
ISBN:
9780201360684
Format :
Book

CD-Rom

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.73.P22 S366 1999 Book and Software Set Central Closed Stacks
Searching...

On Order

Summary

Summary

Provides readers with a jump-start to the language with detailed explanations of the object-oriented capabilities of Perl 5. The CD-ROM features all the programming examples from the book and a complete, ready-to-use Perl distribution for Windows 95/NT, a free Apache Web Server, and modules.


Author Notes

Michael Schilli is a Web Engineer with America Online Inc. and has over eight years professional experience in software development. He is a regular contributor with both iX (European Unix magazine) and the Linux Magazin with monthly columns on Internet programmign with Perl 5.


Table of Contents

Prefacep. v
Introductionp. vii
1 Introduction to Perlp. 1
1.1 Which Perl?p. 1
1.2 Additional modulesp. 2
1.3 Starting successfullyp. 2
1.4 Try and retryp. 2
1.4.1 Help is nearp. 3
1.5 Data types and control structuresp. 4
1.5.1 Scalarsp. 4
1.5.2 Lists and arraysp. 7
1.5.3 Associative arraysp. 18
1.5.4 Functions, packages, and modulesp. 21
1.5.5 Referencesp. 25
1.5.6 Contextp. 29
1.5.7 Anonymous variablesp. 32
1.6 Conditions and error handlingp. 34
1.7 Operatorsp. 36
1.8 Input and outputp. 37
1.8.1 Read accessp. 38
1.8.2 Write accessp. 39
1.8.3 System-related file accessp. 39
1.8.4 The printf functionp. 40
1.8.5 Pipesp. 42
1.8.6 Reading user inputp. 44
1.8.7 Further possibilities of data inputp. 45
1.9 Access to the file systemp. 46
1.9.1 File operatorsp. 47
1.9.2 The stat functionp. 48
1.9.3 Manipulating files in the file systemp. 49
1.9.4 Recursive directory searchp. 50
1.10 Regular expressionsp. 55
1.10.1 How does the matcher work?p. 59
1.10.2 Minimal matchingp. 60
1.10.3 Regular expressions over several linesp. 61
1.10.4 Zero patternsp. 62
1.10.5 Searching for several expressions in a stringp. 62
1.10.6 Masking of metacharactersp. 68
1.10.7 Sample applicationp. 68
1.10.8 Search and replacep. 70
1.10.9 Haute ecole of maskingp. 73
1.11 Perl and the shellp. 76
1.12 Extended data structuresp. 76
1.12.1 Arrays of arraysp. 77
1.12.2 Arrays of hashesp. 77
1.12.3 Summary of extended data constructsp. 78
1.13 Persistent storage of hashes in DBM filesp. 82
1.14 Hints and tricksp. 84
1.14.1 Time and datep. 84
1.14.2 Getting the most out of here documentsp. 84
1.14.3 Stricter variable conventionsp. 85
1.14.4 Error messages with the Carp packagep. 85
1.14.5 Exception handlingp. 87
1.14.6 Protoypesp. 87
1.14.7 Structures with pack and unpackp. 89
1.14.8 Number and encoding systemsp. 91
1.14.9 Dynamic code generation with evalp. 92
1.15 Operating system interfacesp. 93
1.15.1 Processesp. 93
1.15.2 Signalsp. 94
1.15.3 Environmentp. 95
Solutions to the exercisesp. 96
2 Object-oriented programmingp. 109
2.1 Introductionp. 109
2.1.1 Objects, data, and methodsp. 109
2.1.2 Classesp. 110
2.1.3 Class relationshipsp. 111
2.2 Object-oriented Perlp. 112
2.2.1 Classes and modulesp. 113
2.2.2 Objectsp. 114
2.2.3 Methodsp. 115
2.3 A first examplep. 116
2.4 Object-oriented programming in detailp. 120
2.4.1 Package definitionp. 120
2.4.2 Static and virtual methodsp. 120
2.4.3 Constructorsp. 121
2.4.4 Destructorsp. 122
2.4.5 Instance variablesp. 122
2.4.6 Inheritancep. 123
2.4.7 Aggregationp. 130
2.4.8 Associationp. 132
2.4.9 Using relationshipp. 133
2.5 Persistence by inheritancep. 134
2.5.1 Implementationp. 134
1.5.2 Examplep. 138
2.6 Hints and tricksp. 140
2.6.1 The SUPER classp. 140
2.6.1 Delegation with AUTOLOADp. 142
3 Pr t- -porter modulesp. 147
3.1 10::File - the new file handle generationp. 147
3.2 Time measurementsp. 149
3.3 Graphics with the Chart packagep. 151
3.3.1 Barsp. 151
3.3.2 Stacked barsp. 153
3.3.3 Piesp. 154
3.3.4 Lines and marking pointsp. 154
3.3.5 Paretosp. 154
3.4 Controlling processes with Proc::Simplep. 155
3.5 Command line optionsp. 156
3.6 Terminal controlp. 158
3.7 Text processingp. 160
3.8 Date calculationsp. 161
3.9 Packing data in tar formatp. 164
Solutions to the exercisesp. 166
4 Graphical interfaces with Tkp. 169
4.1 Hello Worldp. 169
4.2 Fundamentals of graphical user interfacesp. 170
4.2.1 The X Window systemp. 171
4.2.2 Toolkits and their widgetsp. 171
4.2.3 Tk and Tclp. 171
4.2.4 Event handlingp. 172
4.2.5 Window hierarchyp. 173
4.2.6 Clients and servers in the X Window systemp. 173
4.2.7 The window managerp. 174
4.3 Classes and objects in the Tk packagep. 175
4.4 Optionsp. 176
4.5 The packerp. 178
4.6 Widgets in detailp. 182
4.6.1 Buttonsp. 182
4.6.2 Check buttonsp. 183
4.6.3 Radio buttonsp. 184
4.6.4 Framesp. 186
4.6.5 Entry widgetsp. 189
4.6.6 Labelsp. 190
4.6.7 Listboxesp. 191
4.6.8 Menu widgetsp. 195
4.6.9 Messagesp. 201
4.6.10 Scalesp. 202
4.6.11 Scrollbarsp. 204
4.6.12 Textp. 205
4.6.13 Toplevelp. 209
4.6.14 Canvasp. 211
4.6.15 Photosp. 213
4.7 Widgets in interactionp. 214
4.7.1 The grabp. 214
4.7.2 Waiting for eventsp. 215
4.7.3 Dialog controlp. 215
4.7.4 Communication with the window managerp. 217
4.7.5 Bindingsp. 218
4.7.6 Fonts and colorsp. 219
4.7.7 Bitmapsp. 219
4.8 Hints and tricks for Perl/Tk programmingp. 220
4.8.1 Long-running functionsp. 221
4.8.2 Periodical execution of functionsp. 222
4.9 Sample applicationsp. 227
4.9.1 File selectorp. 227
4.9.2 A small editorp. 236
4.9.3 Hyperlinksp. 240
4.9.4 Font viewerp. 242
4.9.5 Image viewerp. 244
4.9.6 Color viewerp. 245
4.9.7 Viewer for SDBM filesp. 247
5 Perl programming on the Internetp. 249
5.1 Help from the CPANp. 250
5.2 Netiquettep. 250
5.3 FTPp. 251
5.3.1 Net::FTPp. 252
5.3.2 LWP::Simplep. 256
5.4 Introduction to the World Wide Web (WWW)p. 256
5.4.1 HTML as a formatting languagep. 257
5.4.2 Headersp. 258
5.4.3 Hidden actionsp. 259
5.4.4 Errorsp. 260
5.5 Programming with the LWPp. 260
5.5.1 Simple access via LWP::Simplep. 260
5.5.2 General access via LWP::UserAgentp. 263
5.5.3 Robotsp. 271
5.5.4 Practice: checking Web pagesp. 272
5.6 Analyzing URLsp. 276
5.7 Processing of HTML documentsp. 278
5.7.1 ASCII and PostScript conversionp. 279
5.7.2 Analysis of HTML documentsp. 281
5.7.3 Parsing HTMLp. 285
5.7.4 Practice: the grabberp. 289
5.8 CGI programmingp. 293
5.8.1 The client sidep. 294
5.8.2 The server sidep. 296
5.8.3 HTML output with the CGI modulep. 300
5.8.4 Hints and tips for CGI programmingp. 308
5.8.5 Interaction-free CGI examplesp. 310
5.8.6 Client-server interactionp. 316
5.8.7 Apache and mod__perLp. 336
5.8.8 Server push and client pullp. 337
5.8.9 Simulating forms with the user agentp. 341
5.9 Telnetp. 348
5.10 Emailp. 349
5.10.1 Attachmentsp. 350
5.10.2 POP3 clientp. 352
5.11 Usenet newsp. 358
5.11.1 The newsagentp. 361
5.11.2 Practice: freeing news. answers from periodical postingsp. 367
5.11.3 Practice: checking newsgroupsp. 371
Appendicesp. 377
A Installing Perlp. 377
A.1 Basic installationp. 377
A.1.1 Where do I get it?p. 377
A.1.2 Installation under Unixp. 378
A.1.3 Installation under Windows 95 and NTp. 378
A.2 Installing Perl/Tkp. 379
A.3 Installing additional modulesp. 379
A.4 The CPANp. 381
A.4.1 Perl distributionsp. 382
A.4.2 Modulesp. 383
A.4.3 Automatic updatesp. 384
A.4.4 Configuration of the CPAN.pm modulep. 386
A.4.5 Documentationp. 386
A.4.6 If the system administrator refuses ...p. 387
A.5 Legal questionsp. 387
A.6 Installing the SSL library for Libwwwp. 388
A.7 Installation of a Web serverp. 389
A.8 Installing the Apache CGI acceleratorp. 390
B Starting scriptsp. 393
B.1 Unixp. 393
B.2 Windows 95 and NTp. 395
B.3 Important command line optionsp. 395
B.3.1 Line-by-line manipulationp. 395
B.3.2 Determining the versionp. 397
B.3.3 Syntax checkp. 397
B.3.4 Loading additional modulesp. 398
B.3.5 Warning modep. 398
C Troubleshootingp. 399
C.1 Unixp. 399
C.2 Windowsp. 400
C.3 External helpp. 400
C.4 Error diagnostics for Perl/Tk applicationsp. 400
C.4.1 Setting up the display serverp. 401
C.4.2 Conferring X server privilegesp. 401
D HTML quick referencep. 403
D.1 Foreign language special charactersp. 407
E Documentationp. 409
E.1 POD commandsp. 410
E.2 Filtersp. 412
E.2.1 Filter-specific POD commandsp. 413
F Synchronization of parallel processesp. 415
F.1 Exclusive flockp. 415
F.2 Semaphoresp. 419
G Addressesp. 425
G.1 The Perl 5 module listp. 425
G.2 Quick Reference cardsp. 425
G.3 RFCsp. 426
G.4 Additional addressesp. 426
G.4.1 More information on Perl on the WWWp. 426
G.4.2 Newsgroupsp. 427
H Contents of the CD-ROMp. 429
Referencesp. 431
Indexp. 433