Perl Cookbook. 2nd Edition - Helion
ISBN: 978-05-965-5496-5
stron: 968, Format: ebook
Data wydania: 2003-08-21
Księgarnia: Helion
Cena książki: 143,65 zł (poprzednio: 167,03 zł)
Oszczędzasz: 14% (-23,38 zł)
Find a Perl programmer, and you'll find a copy of Perl Cookbook nearby. Perl Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming in Perl. The book contains hundreds of rigorously reviewed Perl "recipes" and thousands of examples ranging from brief one-liners to complete applications.The second edition of Perl Cookbook has been fully updated for Perl 5.8, with extensive changes for Unicode support, I/O layers, mod_perl, and new technologies that have emerged since the previous edition of the book. Recipes have been updated to include the latest modules. New recipes have been added to every chapter of the book, and some chapters have almost doubled in size.Covered topic areas include:
- Manipulating strings, numbers, dates, arrays, and hashes
- Pattern matching and text substitutions
- References, data structures, objects, and classes
- Signals and exceptions
- Screen addressing, menus, and graphical applications
- Managing other processes
- Writing secure scripts
- Client-server programming
- Internet applications programming with mail, news, ftp, and telnet
- CGI and mod_perl programming
- Web programming
Osoby które kupowały "Perl Cookbook. 2nd Edition", wybierały także:
- Hands-On Gradient Boosting with XGBoost and scikit-learn 142,38 zł, (29,90 zł -79%)
- Perl. Mistrzostwo w programowaniu 44,00 zł, (24,20 zł -45%)
- Wielkie umysły programowania. Jak myślą i pracują twórcy najważniejszych języków 79,00 zł, (47,40 zł -40%)
- Learning Perl. Making Easy Things Easy and Hard Things Possible. 7th Edition 169,00 zł, (118,30 zł -30%)
- 100 sposobów na Perl 39,00 zł, (29,25 zł -25%)
Spis treści
Perl Cookbook. 2nd Edition eBook -- spis treści
- Perl Cookbook, 2nd Edition
- SPECIAL OFFER: Upgrade this ebook with OReilly
- A Note Regarding Supplemental Files
- Foreword
- Preface
- Whats in This Book
- What's New in This Edition
- Platform Notes
- Other Books
- Conventions Used in This Book
- Programming Conventions
- Typesetting Conventions
- Documentation Conventions
- We'd Like to Hear from You
- Acknowledgments for the First Edition
- Tom
- Nat
- Acknowledgments for the Second Edition
- Tom
- Nat
- 1. Strings
- Introduction
- The Universal Character Code
- Unicode Support in Perl
- 1.1. Accessing Substrings
- 1.1.1. Problem
- 1.1.2. Solution
- 1.1.3. Discussion
- 1.1.4. See Also
- 1.2. Establishing a Default Value
- 1.2.1. Problem
- 1.2.2. Solution
- 1.2.3. Discussion
- 1.2.4. See Also
- 1.3. Exchanging Values Without Using Temporary Variables
- 1.3.1. Problem
- 1.3.2. Solution
- 1.3.3. Discussion
- 1.3.4. See Also
- 1.4. Converting Between Characters and Values
- 1.4.1. Problem
- 1.4.2. Solution
- 1.4.3. Discussion
- 1.4.4. See Also
- 1.5. Using Named Unicode Characters
- 1.5.1. Problem
- 1.5.2. Solution
- 1.5.3. Discussion
- 1.5.4. See Also
- 1.6. Processing a String One Character at a Time
- 1.6.1. Problem
- 1.6.2. Solution
- 1.6.3. Discussion
- 1.6.4. See Also
- 1.7. Reversing a String by Word or Character
- 1.7.1. Problem
- 1.7.2. Solution
- 1.7.3. Discussion
- 1.7.4. See Also
- 1.8. Treating Unicode Combined Characters as Single Characters
- 1.8.1. Problem
- 1.8.2. Solution
- 1.8.3. Discussion
- 1.8.4. See Also
- 1.9. Canonicalizing Strings with Unicode Combined Characters
- 1.9.1. Problem
- 1.9.2. Solution
- 1.9.3. Discussion
- 1.9.4. See Also
- 1.10. Treating a Unicode String as Octets
- 1.10.1. Problem
- 1.10.2. Solution
- 1.10.3. Discussion
- 1.10.4. See Also
- 1.11. Expanding and Compressing Tabs
- 1.11.1. Problem
- 1.11.2. Solution
- 1.11.3. Discussion
- 1.11.4. See Also
- 1.12. Expanding Variables in User Input
- 1.12.1. Problem
- 1.12.2. Solution
- 1.12.3. Discussion
- 1.12.4. See Also
- 1.13. Controlling Case
- 1.13.1. Problem
- 1.13.2. Solution
- 1.13.3. Discussion
- 1.13.4. See Also
- 1.14. Properly Capitalizing a Title or Headline
- 1.14.1. Problem
- 1.14.2. Solution
- 1.14.3. Discussion
- 1.14.4. See Also
- 1.15. Interpolating Functions and Expressions Within Strings
- 1.15.1. Problem
- 1.15.2. Solution
- 1.15.3. Discussion
- 1.15.4. See Also
- 1.16. Indenting Here Documents
- 1.16.1. Problem
- 1.16.2. Solution
- 1.16.3. Discussion
- 1.16.4. See Also
- 1.17. Reformatting Paragraphs
- 1.17.1. Problem
- 1.17.2. Solution
- 1.17.3. Discussion
- 1.17.4. See Also
- 1.18. Escaping Characters
- 1.18.1. Problem
- 1.18.2. Solution
- 1.18.3. Discussion
- 1.18.4. See Also
- 1.19. Trimming Blanks from the Ends of a String
- 1.19.1. Problem
- 1.19.2. Solution
- 1.19.3. Discussion
- 1.19.4. See Also
- 1.20. Parsing Comma-Separated Data
- 1.20.1. Problem
- 1.20.2. Solution
- 1.20.3. Discussion
- 1.20.4. See Also
- 1.21. Constant Variables
- 1.21.1. Problem
- 1.21.2. Solution
- 1.21.3. Discussion
- 1.21.4. See Also
- 1.22. Soundex Matching
- 1.22.1. Problem
- 1.22.2. Solution
- 1.22.3. Discussion
- 1.22.4. See Also
- 1.23. Program: fixstyle
- 1.24. Program: psgrep
- Introduction
- 2. Numbers
- Introduction
- 2.1. Checking Whether a String Is a Valid Number
- 2.1.1. Problem
- 2.1.2. Solution
- 2.1.3. Discussion
- 2.1.4. See Also
- 2.2. Rounding Floating-Point Numbers
- 2.2.1. Problem
- 2.2.2. Solution
- 2.2.3. Discussion
- 2.2.4. See Also
- 2.3. Comparing Floating-Point Numbers
- 2.3.1. Problem
- 2.3.2. Solution
- 2.3.3. Discussion
- 2.3.4. See Also
- 2.4. Operating on a Series of Integers
- 2.4.1. Problem
- 2.4.2. Solution
- 2.4.3. Discussion
- 2.4.4. See Also
- 2.5. Working with Roman Numerals
- 2.5.1. Problem
- 2.5.2. Solution
- 2.5.3. Discussion
- 2.5.4. See Also
- 2.6. Generating Random Numbers
- 2.6.1. Problem
- 2.6.2. Solution
- 2.6.3. Discussion
- 2.6.4. See Also
- 2.7. Generating Repeatable Random Number Sequences
- 2.7.1. Problem
- 2.7.2. Solution
- 2.7.3. Discussion
- 2.7.4. See Also
- 2.8. Making Numbers Even More Random
- 2.8.1. Problem
- 2.8.2. Solution
- 2.8.3. Discussion
- 2.8.4. See Also
- 2.9. Generating Biased Random Numbers
- 2.9.1. Problem
- 2.9.2. Solution
- 2.9.3. Discussion
- 2.9.4. See Also
- 2.10. Doing Trigonometry in Degrees, Not Radians
- 2.10.1. Problem
- 2.10.2. Solution
- 2.10.3. Discussion
- 2.10.4. See Also
- 2.11. Calculating More Trigonometric Functions
- 2.11.1. Problem
- 2.11.2. Solution
- 2.11.3. Discussion
- 2.11.4. See Also
- 2.12. Taking Logarithms
- 2.12.1. Problem
- 2.12.2. Solution
- 2.12.3. Discussion
- 2.12.4. See Also
- 2.13. Multiplying Matrices
- 2.13.1. Problem
- 2.13.2. Solution
- 2.13.3. Discussion
- 2.13.4. See Also
- 2.14. Using Complex Numbers
- 2.14.1. Problem
- 2.14.2. Solution
- 2.14.3. Discussion
- 2.14.4. See Also
- 2.15. Converting Binary, Octal, and Hexadecimal Numbers
- 2.15.1. Problem
- 2.15.2. Solution
- 2.15.3. Discussion
- 2.15.4. See Also
- 2.16. Putting Commas in Numbers
- 2.16.1. Problem
- 2.16.2. Solution
- 2.16.3. Discussion
- 2.16.4. See Also
- 2.17. Printing Correct Plurals
- 2.17.1. Problem
- 2.17.2. Solution
- 2.17.3. Discussion
- 2.17.4. See Also
- 2.18. Program: Calculating Prime Factors
- 3. Dates and Times
- Introduction
- 3.1. Finding Today's Date
- 3.1.1. Problem
- 3.1.2. Solution
- 3.1.3. Discussion
- 3.1.4. See Also
- 3.2. Converting DMYHMS to Epoch Seconds
- 3.2.1. Problem
- 3.2.2. Solution
- 3.2.3. Discussion
- 3.2.4. See Also
- 3.3. Converting Epoch Seconds to DMYHMS
- 3.3.1. Problem
- 3.3.2. Solution
- 3.3.3. Discussion
- 3.3.4. See Also
- 3.4. Adding to or Subtracting from a Date
- 3.4.1. Problem
- 3.4.2. Solution
- 3.4.3. Discussion
- 3.4.4. See Also
- 3.5. Difference of Two Dates
- 3.5.1. Problem
- 3.5.2. Solution
- 3.5.3. Discussion
- 3.5.4. See Also
- 3.6. Day in a Week/Month/Year or Week Number
- 3.6.1. Problem
- 3.6.2. Solution
- 3.6.3. Discussion
- 3.6.4. See Also
- 3.7. Parsing Dates and Times from Strings
- 3.7.1. Problem
- 3.7.2. Solution
- 3.7.3. Discussion
- 3.7.4. See Also
- 3.8. Printing a Date
- 3.8.1. Problem
- 3.8.2. Solution
- 3.8.3. Discussion
- 3.8.4. See Also
- 3.9. High-Resolution Timers
- 3.9.1. Problem
- 3.9.2. Solution
- 3.9.3. Discussion
- 3.9.4. See Also
- 3.10. Short Sleeps
- 3.10.1. Problem
- 3.10.2. Solution
- 3.10.3. Discussion
- 3.10.4. See Also
- 3.11. Program: hopdelta
- 4. Arrays
- Introduction
- 4.1. Specifying a List in Your Program
- 4.1.1. Problem
- 4.1.2. Solution
- 4.1.3. Discussion
- 4.1.4. See Also
- 4.2. Printing a List with Commas
- 4.2.1. Problem
- 4.2.2. Solution
- 4.2.3. Discussion
- 4.2.4. See Also
- 4.3. Changing Array Size
- 4.3.1. Problem
- 4.3.2. Solution
- 4.3.3. Discussion
- 4.3.4. See Also
- 4.4. Implementing a Sparse Array
- 4.4.1. Problem
- 4.4.2. Solution
- 4.4.3. Discussion
- 4.4.4. See Also
- 4.5. Iterating Over an Array
- 4.5.1. Problem
- 4.5.2. Solution
- 4.5.3. Discussion
- 4.5.4. See Also
- 4.6. Iterating Over an Array by Reference
- 4.6.1. Problem
- 4.6.2. Solution
- 4.6.3. Discussion
- 4.6.4. See Also
- 4.7. Extracting Unique Elements from a List
- 4.7.1. Problem
- 4.7.2. Solution
- 4.7.2.1. Straightforward
- 4.7.2.2. Faster
- 4.7.2.3. Similar but with user function
- 4.7.2.4. Faster but different
- 4.7.2.5. Faster and even more different
- 4.7.3. Discussion
- 4.7.4. See Also
- 4.8. Finding Elements in One Array but Not Another
- 4.8.1. Problem
- 4.8.2. Solution
- 4.8.2.1. Straightforward implementation
- 4.8.2.2. More idiomatic version
- 4.8.2.3. Loopless version
- 4.8.3. Discussion
- 4.8.4. See Also
- 4.9. Computing Union, Intersection, or Difference of Unique Lists
- 4.9.1. Problem
- 4.9.2. Solution
- 4.9.2.1. Simple solution for union and intersection
- 4.9.2.2. More idiomatic version
- 4.9.2.3. Union, intersection, and symmetric difference
- 4.9.2.4. Indirect solution
- 4.9.3. Discussion
- 4.9.4. See Also
- 4.10. Appending One Array to Another
- 4.10.1. Problem
- 4.10.2. Solution
- 4.10.3. Discussion
- 4.10.4. See Also
- 4.11. Reversing an Array
- 4.11.1. Problem
- 4.11.2. Solution
- 4.11.3. Discussion
- 4.11.4. See Also
- 4.12. Processing Multiple Elements of an Array
- 4.12.1. Problem
- 4.12.2. Solution
- 4.12.3. Discussion
- 4.12.4. See Also
- 4.13. Finding the First List Element That Passes a Test
- 4.13.1. Problem
- 4.13.2. Solution
- 4.13.3. Discussion
- 4.13.4. See Also
- 4.14. Finding All Elements in an Array Matching Certain Criteria
- 4.14.1. Problem
- 4.14.2. Solution
- 4.14.3. Discussion
- 4.14.4. See Also
- 4.15. Sorting an Array Numerically
- 4.15.1. Problem
- 4.15.2. Solution
- 4.15.3. Discussion
- 4.15.4. See Also
- 4.16. Sorting a List by Computable Field
- 4.16.1. Problem
- 4.16.2. Solution
- 4.16.3. Discussion
- 4.16.4. See Also
- 4.17. Implementing a Circular List
- 4.17.1. Problem
- 4.17.2. Solution
- 4.17.3. Procedure
- 4.17.4. Discussion
- 4.17.5. See Also
- 4.18. Randomizing an Array
- 4.18.1. Problem
- 4.18.2. Solution
- 4.18.3. Discussion
- 4.18.4. See Also
- 4.19. Program: words
- 4.19.1. See Also
- 4.20. Program: permute
- 4.20.1. See Also
- 5. Hashes
- Introduction
- See Also
- 5.1. Adding an Element to a Hash
- 5.1.1. Problem
- 5.1.2. Solution
- 5.1.3. Discussion
- 5.1.4. See Also
- 5.2. Testing for the Presence of a Key in a Hash
- 5.2.1. Problem
- 5.2.2. Solution
- 5.2.3. Discussion
- 5.2.4. See Also
- 5.3. Creating a Hash with Immutable Keys or Values
- 5.3.1. Problem
- 5.3.2. Solution
- 5.3.3. Discussion
- 5.3.4. See Also
- 5.4. Deleting from a Hash
- 5.4.1. Problem
- 5.4.2. Solution
- 5.4.3. Discussion
- 5.4.4. See Also
- 5.5. Traversing a Hash
- 5.5.1. Problem
- 5.5.2. Solution
- 5.5.3. Discussion
- 5.5.4. See Also
- 5.6. Printing a Hash
- 5.6.1. Problem
- 5.6.2. Solution
- 5.6.3. Discussion
- 5.6.4. See Also
- 5.7. Retrieving from a Hash in Insertion Order
- 5.7.1. Problem
- 5.7.2. Solution
- 5.7.3. Discussion
- 5.7.4. See Also
- 5.8. Hashes with Multiple Values per Key
- 5.8.1. Problem
- 5.8.2. Solution
- 5.8.3. Discussion
- 5.8.4. See Also
- 5.9. Inverting a Hash
- 5.9.1. Problem
- 5.9.2. Solution
- 5.9.3. Discussion
- 5.9.4. See Also
- 5.10. Sorting a Hash
- 5.10.1. Problem
- 5.10.2. Solution
- 5.10.3. Discussion
- 5.10.4. See Also
- 5.11. Merging Hashes
- 5.11.1. Problem
- 5.11.2. Solution
- 5.11.3. Discussion
- 5.11.4. See Also
- 5.12. Finding Common or Different Keys in Two Hashes
- 5.12.1. Problem
- 5.12.2. Solution
- 5.12.2.1. Find common keys
- 5.12.2.2. Find keys from one hash that aren't in both
- 5.12.3. Discussion
- 5.12.4. See Also
- 5.13. Hashing References
- 5.13.1. Problem
- 5.13.2. Solution
- 5.13.3. Discussion
- 5.13.4. See Also
- 5.14. Presizing a Hash
- 5.14.1. Problem
- 5.14.2. Solution
- 5.14.3. Discussion
- 5.14.4. See Also
- 5.15. Finding the Most Common Anything
- 5.15.1. Problem
- 5.15.2. Solution
- 5.15.3. Discussion
- 5.15.4. See Also
- 5.16. Representing Relationships Between Data
- 5.16.1. Problem
- 5.16.2. Solution
- 5.16.3. Discussion
- 5.16.4. See Also
- 5.17. Program: dutree
- Introduction
- 6. Pattern Matching
- Introduction
- The Tricky Bits
- Pattern-Matching Modifiers
- Special Variables
- 6.1. Copying and Substituting Simultaneously
- 6.1.1. Problem
- 6.1.2. Solution
- 6.1.3. Discussion
- 6.1.4. See Also
- 6.2. Matching Letters
- 6.2.1. Problem
- 6.2.2. Solution
- 6.2.3. Discussion
- 6.2.4. See Also
- 6.3. Matching Words
- 6.3.1. Problem
- 6.3.2. Solution
- 6.3.3. Discussion
- 6.3.4. See Also
- 6.4. Commenting Regular Expressions
- 6.4.1. Problem
- 6.4.2. Solution
- 6.4.3. Discussion
- 6.4.4. See Also
- 6.5. Finding the Nth Occurrence of a Match
- 6.5.1. Problem
- 6.5.2. Solution
- 6.5.3. Discussion
- 6.5.4. See Also
- 6.6. Matching Within Multiple Lines
- 6.6.1. Problem
- 6.6.2. Solution
- 6.6.3. Discussion
- 6.6.4. See Also
- 6.7. Reading Records with a Separator
- 6.7.1. Problem
- 6.7.2. Solution
- 6.7.3. Discussion
- 6.7.4. See Also
- 6.8. Extracting a Range of Lines
- 6.8.1. Problem
- 6.8.2. Solution
- 6.8.3. Discussion
- 6.8.4. See Also
- 6.9. Matching Shell Globs as Regular Expressions
- 6.9.1. Problem
- 6.9.2. Solution
- 6.9.3. Discussion
- 6.9.4. See Also
- 6.10. Speeding Up Interpolated Matches
- 6.10.1. Problem
- 6.10.2. Solution
- 6.10.3. Discussion
- 6.10.4. See Also
- 6.11. Testing for a Valid Pattern
- 6.11.1. Problem
- 6.11.2. Solution
- 6.11.3. Discussion
- 6.11.4. See Also
- 6.12. Honoring Locale Settings in Regular Expressions
- 6.12.1. Problem
- 6.12.2. Solution
- 6.12.3. Discussion
- 6.12.4. See Also
- 6.13. Approximate Matching
- 6.13.1. Problem
- 6.13.2. Solution
- 6.13.3. Discussion
- 6.13.4. See Also
- 6.14. Matching from Where the Last Pattern Left Off
- 6.14.1. Problem
- 6.14.2. Solution
- 6.14.3. Discussion
- 6.14.4. See Also
- 6.15. Greedy and Non-Greedy Matches
- 6.15.1. Problem
- 6.15.2. Solution
- 6.15.3. Discussion
- 6.15.4. See Also
- 6.16. Detecting Doubled Words
- 6.16.1. Problem
- 6.16.2. Solution
- 6.16.3. Discussion
- 6.16.4. See Also
- 6.17. Matching Nested Patterns
- 6.17.1. Problem
- 6.17.2. Solution
- 6.17.3. Discussion
- 6.17.4. See Also
- 6.18. Expressing AND, OR, and NOT in a Single Pattern
- 6.18.1. Problem
- 6.18.2. Solution
- 6.18.3. Discussion
- 6.18.4. See Also
- 6.19. Matching a Valid Mail Address
- 6.19.1. Problem
- 6.19.2. Solution
- 6.19.3. Discussion
- 6.19.4. See Also
- 6.20. Matching Abbreviations
- 6.20.1. Problem
- 6.20.2. Solution
- 6.20.3. Discussion
- 6.20.4. See Also
- 6.21. Program: urlify
- 6.22. Program: tcgrep
- 6.23. Regular Expression Grab Bag
- Introduction
- 7. File Access
- Introduction
- Getting a Handle on the File
- Standard Filehandles
- I/O Operations
- 7.1. Opening a File
- 7.1.1. Problem
- 7.1.2. Solution
- 7.1.3. Discussion
- 7.1.4. See Also
- 7.2. Opening Files with Unusual Filenames
- 7.2.1. Problem
- 7.2.2. Solution
- 7.2.3. Discussion
- 7.2.4. See Also
- 7.3. Expanding Tildes in Filenames
- 7.3.1. Problem
- 7.3.2. Solution
- 7.3.3. Discussion
- 7.3.4. See Also
- 7.4. Making Perl Report Filenames in Error Messages
- 7.4.1. Problem
- 7.4.2. Solution
- 7.4.3. Discussion
- 7.4.4. See Also
- 7.5. Storing Filehandles into Variables
- 7.5.1. Problem
- 7.5.2. Solution
- 7.5.3. Discussion
- 7.5.4. See Also
- 7.6. Writing a Subroutine That Takes Filehandles as Built-ins Do
- 7.6.1. Problem
- 7.6.2. Solution
- 7.6.3. Discussion
- 7.6.4. See Also
- 7.7. Caching Open Output Filehandles
- 7.7.1. Problem
- 7.7.2. Solution
- 7.7.3. Discussion
- 7.7.4. See Also
- 7.8. Printing to Many Filehandles Simultaneously
- 7.8.1. Problem
- 7.8.2. Solution
- 7.8.3. Discussion
- 7.8.4. See Also
- 7.9. Opening and Closing File Descriptors by Number
- 7.9.1. Problem
- 7.9.2. Solution
- 7.9.3. Discussion
- 7.9.4. See Also
- 7.10. Copying Filehandles
- 7.10.1. Problem
- 7.10.2. Solution
- 7.10.3. Discussion
- 7.10.4. See Also
- 7.11. Creating Temporary Files
- 7.11.1. Problem
- 7.11.2. Solution
- 7.11.3. Discussion
- 7.11.4. See Also
- 7.12. Storing a File Inside Your Program Text
- 7.12.1. Problem
- 7.12.2. Solution
- 7.12.3. Discussion
- 7.12.4. See Also
- 7.13. Storing Multiple Files in the DATA Area
- 7.13.1. Problem
- 7.13.2. Solution
- 7.13.3. Discussion
- 7.13.4. See Also
- 7.14. Writing a Unix-Style Filter Program
- 7.14.1. Problem
- 7.14.2. Solution
- 7.14.3. Discussion
- 7.14.3.1. Behavior
- 7.14.3.2. Command-line options
- 7.14.4. See Also
- 7.15. Modifying a File in Place with a Temporary File
- 7.15.1. Problem
- 7.15.2. Solution
- 7.15.3. Discussion
- 7.15.4. See Also
- 7.16. Modifying a File in Place with the -i Switch
- 7.16.1. Problem
- 7.16.2. Solution
- 7.16.3. Discussion
- 7.16.4. See Also
- 7.17. Modifying a File in Place Without a Temporary File
- 7.17.1. Problem
- 7.17.2. Solution
- 7.17.3. Discussion
- 7.17.4. See Also
- 7.18. Locking a File
- 7.18.1. Problem
- 7.18.2. Solution
- 7.18.3. Discussion
- 7.18.4. See Also
- 7.19. Flushing Output
- 7.19.1. Problem
- 7.19.2. Solution
- 7.19.3. Discussion
- 7.19.4. See Also
- 7.20. Doing Non-Blocking I/O
- 7.20.1. Problem
- 7.20.2. Solution
- 7.20.3. Discussion
- 7.20.4. See Also
- 7.21. Determining the Number of Unread Bytes
- 7.21.1. Problem
- 7.21.2. Solution
- 7.21.3. Discussion
- 7.21.4. See Also
- 7.22. Reading from Many Filehandles Without Blocking
- 7.22.1. Problem
- 7.22.2. Solution
- 7.22.3. Discussion
- 7.22.4. See Also
- 7.23. Reading an Entire Line Without Blocking
- 7.23.1. Problem
- 7.23.2. Solution
- 7.23.3. Discussion
- 7.23.4. See Also
- 7.24. Program: netlock
- 7.25. Program: lockarea
- Introduction
- 8. File Contents
- Introduction
- Basic Operations
- Newlines
- I/O Layers
- Advanced Operations
- 8.1. Reading Lines with Continuation Characters
- 8.1.1. Problem
- 8.1.2. Solution
- 8.1.3. Discussion
- 8.1.4. See Also
- 8.2. Counting Lines (or Paragraphs or Records) in a File
- 8.2.1. Problem
- 8.2.2. Solution
- 8.2.3. Discussion
- 8.2.4. See Also
- 8.3. Processing Every Word in a File
- 8.3.1. Problem
- 8.3.2. Solution
- 8.3.3. Discussion
- 8.3.4. See Also
- 8.4. Reading a File Backward by Line or Paragraph
- 8.4.1. Problem
- 8.4.2. Solution
- 8.4.3. Discussion
- 8.4.4. See Also
- 8.5. Trailing a Growing File
- 8.5.1. Problem
- 8.5.2. Solution
- 8.5.3. Discussion
- 8.5.4. See Also
- 8.6. Picking a Random Line from a File
- 8.6.1. Problem
- 8.6.2. Solution
- 8.6.3. Discussion
- 8.6.4. See Also
- 8.7. Randomizing All Lines
- 8.7.1. Problem
- 8.7.2. Solution
- 8.7.3. Discussion
- 8.7.4. See Also
- 8.8. Reading a Particular Line in a File
- 8.8.1. Problem
- 8.8.2. Solution
- 8.8.3. Discussion
- 8.8.4. See Also
- 8.9. Processing Variable-Length Text Fields
- 8.9.1. Problem
- 8.9.2. Solution
- 8.9.3. Discussion
- 8.9.4. See Also
- 8.10. Removing the Last Line of a File
- 8.10.1. Problem
- 8.10.2. Solution
- 8.10.3. Discussion
- 8.10.4. See Also
- 8.11. Processing Binary Files
- 8.11.1. Problem
- 8.11.2. Solution
- 8.11.3. Discussion
- 8.11.4. See Also
- 8.12. Using Random-Access I/O
- 8.12.1. Problem
- 8.12.2. Solution
- 8.12.3. Discussion
- 8.12.4. See Also
- 8.13. Updating a Random-Access File
- 8.13.1. Problem
- 8.13.2. Solution
- 8.13.3. Discussion
- 8.13.4. See Also
- 8.14. Reading a String from a Binary File
- 8.14.1. Problem
- 8.14.2. Solution
- 8.14.3. Discussion
- 8.14.4. See Also
- 8.15. Reading Fixed-Length Records
- 8.15.1. Problem
- 8.15.2. Solution
- 8.15.3. Discussion
- 8.15.4. See Also
- 8.16. Reading Configuration Files
- 8.16.1. Problem
- 8.16.2. Solution
- 8.16.3. Discussion
- 8.16.4. See Also
- 8.17. Testing a File for Trustworthiness
- 8.17.1. Problem
- 8.17.2. Solution
- 8.17.3. Discussion
- 8.17.4. See Also
- 8.18. Treating a File as an Array
- 8.18.1. Problem
- 8.18.2. Solution
- 8.18.3. Discussion
- 8.18.4. See Also
- 8.19. Setting the Default I/O Layers
- 8.19.1. Problem
- 8.19.2. Solution
- 8.19.3. Discussion
- 8.19.4. See Also
- 8.20. Reading or Writing Unicode from a Filehandle
- 8.20.1. Problem
- 8.20.2. Solution
- 8.20.3. Discussion
- 8.20.4. See Also
- 8.21. Converting Microsoft Text Files into Unicode
- 8.21.1. Problem
- 8.21.2. Solution
- 8.21.3. Discussion
- 8.21.4. See Also
- 8.22. Comparing the Contents of Two Files
- 8.22.1. Problem
- 8.22.2. Solution
- 8.22.3. Discussion
- 8.22.4. See Also
- 8.23. Pretending a String Is a File
- 8.23.1. Problem
- 8.23.2. Solution
- 8.23.3. Discussion
- 8.23.4. See Also
- 8.24. Program: tailwtmp
- 8.25. Program: tctee
- 8.26. Program: laston
- 8.27. Program: Flat File Indexes
- Introduction
- 9. Directories
- Introduction
- Executive Summary
- 9.1. Getting and Setting Timestamps
- 9.1.1. Problem
- 9.1.2. Solution
- 9.1.3. Discussion
- 9.1.4. See Also
- 9.2. Deleting a File
- 9.2.1. Problem
- 9.2.2. Solution
- 9.2.3. Discussion
- 9.2.4. See Also
- 9.3. Copying or Moving a File
- 9.3.1. Problem
- 9.3.2. Solution
- 9.3.3. Discussion
- 9.3.4. See Also
- 9.4. Recognizing Two Names for the Same File
- 9.4.1. Problem
- 9.4.2. Solution
- 9.4.3. Discussion
- 9.4.4. See Also
- 9.5. Processing All Files in a Directory
- 9.5.1. Problem
- 9.5.2. Solution
- 9.5.3. Discussion
- 9.5.4. See Also
- 9.6. Globbing, or Getting a List of Filenames Matching a Pattern
- 9.6.1. Problem
- 9.6.2. Solution
- 9.6.3. Discussion
- 9.6.4. See Also
- 9.7. Processing All Files in a Directory Recursively
- 9.7.1. Problem
- 9.7.2. Solution
- 9.7.3. Discussion
- 9.7.4. See Also
- 9.8. Removing a Directory and Its Contents
- 9.8.1. Problem
- 9.8.2. Solution
- 9.8.3. Discussion
- 9.8.4. See Also
- 9.9. Renaming Files
- 9.9.1. Problem
- 9.9.2. Solution
- 9.9.3. Discussion
- 9.9.4. See Also
- 9.10. Splitting a Filename into Its Component Parts
- 9.10.1. Problem
- 9.10.2. Solution
- 9.10.3. Discussion
- 9.10.4. See Also
- 9.11. Working with Symbolic File Permissions Instead of Octal Values
- 9.11.1. Problem
- 9.11.2. Solution
- 9.11.3. Discussion
- 9.11.4. See Also
- 9.12. Program: symirror
- 9.13. Program: lst
- Introduction
- 10. Subroutines
- Introduction
- 10.1. Accessing Subroutine Arguments
- 10.1.1. Problem
- 10.1.2. Solution
- 10.1.3. Discussion
- 10.1.4. See Also
- 10.2. Making Variables Private to a Function
- 10.2.1. Problem
- 10.2.2. Solution
- 10.2.3. Discussion
- 10.2.4. See Also
- 10.3. Creating Persistent Private Variables
- 10.3.1. Problem
- 10.3.2. Solution
- 10.3.3. Discussion
- 10.3.4. See Also
- 10.4. Determining Current Function Name
- 10.4.1. Problem
- 10.4.2. Solution
- 10.4.3. Discussion
- 10.4.4. See Also
- 10.5. Passing Arrays and Hashes by Reference
- 10.5.1. Problem
- 10.5.2. Solution
- 10.5.3. Discussion
- 10.5.4. See Also
- 10.6. Detecting Return Context
- 10.6.1. Problem
- 10.6.2. Solution
- 10.6.3. Discussion
- 10.6.4. See Also
- 10.7. Passing by Named Parameter
- 10.7.1. Problem
- 10.7.2. Solution
- 10.7.3. Discussion
- 10.7.4. See Also
- 10.8. Skipping Selected Return Values
- 10.8.1. Problem
- 10.8.2. Solution
- 10.8.3. Discussion
- 10.8.4. See Also
- 10.9. Returning More Than One Array or Hash
- 10.9.1. Problem
- 10.9.2. Solution
- 10.9.3. Discussion
- 10.9.4. See Also
- 10.10. Returning Failure
- 10.10.1. Problem
- 10.10.2. Solution
- 10.10.3. Discussion
- 10.10.4. See Also
- 10.11. Prototyping Functions
- 10.11.1. Problem
- 10.11.2. Solution
- 10.11.3. Discussion
- 10.11.3.1. Omitting parentheses
- 10.11.3.2. Mimicking built-ins
- 10.11.4. See Also
- 10.12. Handling Exceptions
- 10.12.1. Problem
- 10.12.2. Solution
- 10.12.3. Discussion
- 10.12.4. See Also
- 10.13. Saving Global Values
- 10.13.1. Problem
- 10.13.2. Solution
- 10.13.3. Discussion
- 10.13.3.1. Using local( ) for temporary values for globals
- 10.13.3.2. Using local( ) for local handles
- 10.13.3.3. Using local( ) on parts of aggregates
- 10.13.4. See Also
- 10.14. Redefining a Function
- 10.14.1. Problem
- 10.14.2. Solution
- 10.14.3. Discussion
- 10.14.4. See Also
- 10.15. Trapping Undefined Function Calls with AUTOLOAD
- 10.15.1. Problem
- 10.15.2. Solution
- 10.15.3. Discussion
- 10.15.4. See Also
- 10.16. Nesting Subroutines
- 10.16.1. Problem
- 10.16.2. Solution
- 10.16.3. Discussion
- 10.16.4. See Also
- 10.17. Writing a Switch Statement
- 10.17.1. Problem
- 10.17.2. Solution
- 10.17.3. Discussion
- 10.17.4. See Also
- 10.18. Program: Sorting Your Mail
- 10.18.1. See Also
- 11. References and Records
- Introduction
- References
- Anonymous Data
- Records
- See Also
- 11.1. Taking References to Arrays
- 11.1.1. Problem
- 11.1.2. Solution
- 11.1.3. Discussion
- 11.1.4. See Also
- 11.2. Making Hashes of Arrays
- 11.2.1. Problem
- 11.2.2. Solution
- 11.2.3. Discussion
- 11.2.4. See Also
- 11.3. Taking References to Hashes
- 11.3.1. Problem
- 11.3.2. Solution
- 11.3.3. Discussion
- 11.3.4. See Also
- 11.4. Taking References to Functions
- 11.4.1. Problem
- 11.4.2. Solution
- 11.4.3. Discussion
- 11.4.4. See Also
- 11.5. Taking References to Scalars
- 11.5.1. Problem
- 11.5.2. Solution
- 11.5.3. Discussion
- 11.5.4. See Also
- 11.6. Creating Arrays of Scalar References
- 11.6.1. Problem
- 11.6.2. Solution
- 11.6.3. Discussion
- 11.6.4. See Also
- 11.7. Using Closures Instead of Objects
- 11.7.1. Problem
- 11.7.2. Solution
- 11.7.3. Discussion
- 11.7.4. See Also
- 11.8. Creating References to Methods
- 11.8.1. Problem
- 11.8.2. Solution
- 11.8.3. Discussion
- 11.8.4. See Also
- 11.9. Constructing Records
- 11.9.1. Problem
- 11.9.2. Solution
- 11.9.3. Discussion
- 11.9.4. See Also
- 11.10. Reading and Writing Hash Records to Text Files
- 11.10.1. Problem
- 11.10.2. Solution
- 11.10.3. Discussion
- 11.10.4. See Also
- 11.11. Printing Data Structures
- 11.11.1. Problem
- 11.11.2. Solution
- 11.11.3. Discussion
- 11.11.4. See Also
- 11.12. Copying Data Structures
- 11.12.1. Problem
- 11.12.2. Solution
- 11.12.3. Discussion
- 11.12.4. See Also
- 11.13. Storing Data Structures to Disk
- 11.13.1. Problem
- 11.13.2. Solution
- 11.13.3. Discussion
- 11.13.4. See Also
- 11.14. Transparently Persistent Data Structures
- 11.14.1. Problem
- 11.14.2. Solution
- 11.14.3. Discussion
- 11.14.4. See Also
- 11.15. Coping with Circular Data Structures Using Weak References
- 11.15.1. Problem
- 11.15.2. Solution
- 11.15.3. Description
- 11.15.4. See Also
- 11.16. Program: Outlines
- 11.17. Program: Binary Trees
- Introduction
- 12. Packages, Libraries, and Modules
- Introduction
- Modules
- Import/Export Regulations
- Other Kinds of Library Files
- Not Reinventing the Wheel
- See Also
- 12.1. Defining a Module's Interface
- 12.1.1. Problem
- 12.1.2. Solution
- 12.1.3. Discussion
- 12.1.4. See Also
- 12.2. Trapping Errors in require or use
- 12.2.1. Problem
- 12.2.2. Solution
- 12.2.3. Discussion
- 12.2.4. See Also
- 12.3. Delaying use Until Runtime
- 12.3.1. Problem
- 12.3.2. Solution
- 12.3.3. Discussion
- 12.3.4. See Also
- 12.4. Making Variables Private to a Module
- 12.4.1. Problem
- 12.4.2. Solution
- 12.4.3. Discussion
- 12.4.4. See Also
- 12.5. Making Functions Private to a Module
- 12.5.1. Problem
- 12.5.2. Solution
- 12.5.3. Discussion
- 12.5.4. See Also
- 12.6. Determining the Caller's Package
- 12.6.1. Problem
- 12.6.2. Solution
- 12.6.3. Discussion
- 12.6.4. See Also
- 12.7. Automating Module Cleanup
- 12.7.1. Problem
- 12.7.2. Solution
- 12.7.3. Discussion
- 12.7.4. See Also
- 12.8. Keeping Your Own Module Directory
- 12.8.1. Problem
- 12.8.2. Solution
- 12.8.3. Discussion
- 12.8.4. See Also
- 12.9. Preparing a Module for Distribution
- 12.9.1. Problem
- 12.9.2. Solution
- 12.9.3. Discussion
- 12.9.4. See Also
- 12.10. Speeding Module Loading with SelfLoader
- 12.10.1. Problem
- 12.10.2. Solution
- 12.10.3. Discussion
- 12.10.4. See Also
- 12.11. Speeding Up Module Loading with Autoloader
- 12.11.1. Problem
- 12.11.2. Solution
- 12.11.3. Discussion
- 12.11.4. See Also
- 12.12. Overriding Built-in Functions
- 12.12.1. Problem
- 12.12.2. Solution
- 12.12.3. Discussion
- 12.12.4. See Also
- 12.13. Overriding a Built-in Function in All Packages
- 12.13.1. Problem
- 12.13.2. Solution
- 12.13.3. Discussion
- 12.13.4. See Also
- 12.14. Reporting Errors and Warnings Like Built-ins
- 12.14.1. Problem
- 12.14.2. Solution
- 12.14.3. Discussion
- 12.14.4. See Also
- 12.15. Customizing Warnings
- 12.15.1. Problem
- 12.15.2. Solution
- 12.15.3. Discussion
- 12.15.4. See Also
- 12.16. Referring to Packages Indirectly
- 12.16.1. Problem
- 12.16.2. Solution
- 12.16.3. Discussion
- 12.16.4. See Also
- 12.17. Using h2ph to Translate C #include Files
- 12.17.1. Problem
- 12.17.2. Solution
- 12.17.3. Discussion
- 12.17.4. See Also
- 12.18. Using h2xs to Make a Module with C Code
- 12.18.1. Problem
- 12.18.2. Solution
- 12.18.3. Discussion
- 12.18.4. See Also
- 12.19. Writing Extensions in C with Inline::C
- 12.19.1. Problem
- 12.19.2. Solution
- 12.19.3. Discussion
- 12.19.4. See Also
- 12.20. Documenting Your Module with Pod
- 12.20.1. Problem
- 12.20.2. Solution
- 12.20.3. Discussion
- 12.20.4. See Also
- 12.21. Building and Installing a CPAN Module
- 12.21.1. Problem
- 12.21.2. Solution
- 12.21.3. Discussion
- 12.21.4. See Also
- 12.22. Example: Module Template
- 12.23. Program: Finding Versions and Descriptions of Installed Modules
- Introduction
- 13. Classes, Objects, and Ties
- Introduction
- Under the Hood
- Methods
- Inheritance
- A Warning on Indirect Object Notation
- Some Notes on Object Terminology
- Philosophical Aside
- See Also
- 13.1. Constructing an Object
- 13.1.1. Problem
- 13.1.2. Solution
- 13.1.3. Discussion
- 13.1.4. See Also
- 13.2. Destroying an Object
- 13.2.1. Problem
- 13.2.2. Solution
- 13.2.3. Discussion
- 13.2.4. See Also
- 13.3. Managing Instance Data
- 13.3.1. Problem
- 13.3.2. Solution
- 13.3.3. Discussion
- 13.3.4. See Also
- 13.4. Managing Class Data
- 13.4.1. Problem
- 13.4.2. Solution
- 13.4.3. Discussion
- 13.4.4. See Also
- 13.5. Using Classes as Structs
- 13.5.1. Problem
- 13.5.2. Solution
- 13.5.3. Discussion
- 13.5.4. See Also
- 13.6. Cloning Constructors
- 13.6.1. Problem
- 13.6.2. Solution
- 13.6.3. Discussion
- 13.6.4. See Also
- 13.7. Copy Constructors
- 13.7.1. Problem
- 13.7.2. Solution
- 13.7.3. Discussion
- 13.7.4. See Also
- 13.8. Invoking Methods Indirectly
- 13.8.1. Problem
- 13.8.2. Solution
- 13.8.3. Discussion
- 13.8.4. See Also
- 13.9. Determining Subclass Membership
- 13.9.1. Problem
- 13.9.2. Solution
- 13.9.3. Discussion
- 13.9.4. See Also
- 13.10. Writing an Inheritable Class
- 13.10.1. Problem
- 13.10.2. Solution
- 13.10.3. Discussion
- 13.10.4. See Also
- 13.11. Accessing Overridden Methods
- 13.11.1. Problem
- 13.11.2. Solution
- 13.11.3. Discussion
- 13.11.4. See Also
- 13.12. Generating Attribute Methods Using AUTOLOAD
- 13.12.1. Problem
- 13.12.2. Solution
- 13.12.3. Discussion
- 13.12.4. See Also
- 13.13. Coping with Circular Data Structures Using Objects
- 13.13.1. Problem
- 13.13.2. Solution
- 13.13.3. Discussion
- 13.13.4. See Also
- 13.14. Overloading Operators
- 13.14.1. Problem
- 13.14.2. Solution
- 13.14.3. Discussion
- 13.14.4. Example: Overloaded StrNum Class
- 13.14.5. Example: Overloaded FixNum Class
- 13.14.6. See Also
- 13.15. Creating Magic Variables with tie
- 13.15.1. Problem
- 13.15.2. Solution
- 13.15.3. Discussion
- 13.15.4. Tie Example: Outlaw $_
- 13.15.5. Tie Example: Make a Hash That Always Appends
- 13.15.6. Tie Example: Case-Insensitive Hash
- 13.15.7. Tie Example: Hash That Allows Lookups by Key or Value
- 13.15.8. Tie Example: Handle That Counts Access
- 13.15.9. Tie Example: Multiple Sink Filehandles
- 13.15.10. See Also
- Introduction
- 14. Database Access
- Introduction
- 14.1. Making and Using a DBM File
- 14.1.1. Problem
- 14.1.2. Solution
- 14.1.3. Discussion
- 14.1.4. See Also
- 14.2. Emptying a DBM File
- 14.2.1. Problem
- 14.2.2. Solution
- 14.2.3. Discussion
- 14.2.4. See Also
- 14.3. Converting Between DBM Files
- 14.3.1. Problem
- 14.3.2. Solution
- 14.3.3. Discussion
- 14.3.4. See Also
- 14.4. Merging DBM Files
- 14.4.1. Problem
- 14.4.2. Solution
- 14.4.3. Discussion
- 14.4.4. See Also
- 14.5. Sorting Large DBM Files
- 14.5.1. Problem
- 14.5.2. Solution
- 14.5.3. Description
- 14.5.4. See Also
- 14.6. Storing Complex Data in a DBM File
- 14.6.1. Problem
- 14.6.2. Solution
- 14.6.3. Discussion
- 14.6.4. See Also
- 14.7. Persistent Data
- 14.7.1. Problem
- 14.7.2. Solution
- 14.7.3. Discussion
- 14.7.4. See Also
- 14.8. Saving Query Results to Excel or CSV
- 14.8.1. Problem
- 14.8.2. Solution
- 14.8.3. Discussion
- 14.8.4. See Also
- 14.9. Executing an SQL Command Using DBI
- 14.9.1. Problem
- 14.9.2. Solution
- 14.9.3. Discussion
- 14.9.4. See Also
- 14.10. Escaping Quotes
- 14.10.1. Problem
- 14.10.2. Solution
- 14.10.3. Discussion
- 14.10.4. See Also
- 14.11. Dealing with Database Errors
- 14.11.1. Problem
- 14.11.2. Solution
- 14.11.3. Discussion
- 14.11.4. See Also
- 14.12. Repeating Queries Efficiently
- 14.12.1. Problem
- 14.12.2. Solution
- 14.12.3. Discussion
- 14.12.4. See Also
- 14.13. Building Queries Programmatically
- 14.13.1. Problem
- 14.13.2. Solution
- 14.13.3. Discussion
- 14.13.4. See Also
- 14.14. Finding the Number of Rows Returned by a Query
- 14.14.1. Problem
- 14.14.2. Solution
- 14.14.3. Discussion
- 14.14.4. See Also
- 14.15. Using Transactions
- 14.15.1. Problem
- 14.15.2. Solution
- 14.15.3. Discussion
- 14.15.4. See Also
- 14.16. Viewing Data One Page at a Time
- 14.16.1. Problem
- 14.16.2. Solution
- 14.16.3. Discussion
- 14.16.4. See Also
- 14.17. Querying a CSV File with SQL
- 14.17.1. Problem
- 14.17.2. Solution
- 14.17.3. Discussion
- 14.17.4. See Also
- 14.18. Using SQL Without a Database Server
- 14.18.1. Problem
- 14.18.2. Solution
- 14.18.3. Discussion
- 14.18.4. See Also
- 14.19. Program: gghGrep Netscape Global History
- 14.19.1. See Also
- 15. Interactivity
- Introduction
- 15.1. Parsing Program Arguments
- 15.1.1. Problem
- 15.1.2. Solution
- 15.1.3. Discussion
- 15.1.4. See Also
- 15.2. Testing Whether a Program Is Running Interactively
- 15.2.1. Problem
- 15.2.2. Solution
- 15.2.3. Discussion
- 15.2.4. See Also
- 15.3. Clearing the Screen
- 15.3.1. Problem
- 15.3.2. Solution
- 15.3.3. Discussion
- 15.3.4. See Also
- 15.4. Determining Terminal or Window Size
- 15.4.1. Problem
- 15.4.2. Solution
- 15.4.3. Discussion
- 15.4.4. See Also
- 15.5. Changing Text Color
- 15.5.1. Problem
- 15.5.2. Solution
- 15.5.3. Discussion
- 15.5.4. See Also
- 15.6. Reading Single Characters from the Keyboard
- 15.6.1. Problem
- 15.6.2. Solution
- 15.6.3. Discussion
- 15.6.4. See Also
- 15.7. Ringing the Terminal Bell
- 15.7.1. Problem
- 15.7.2. Solution
- 15.7.3. Discussion
- 15.7.4. See Also
- 15.8. Using POSIX termios
- 15.8.1. Problem
- 15.8.2. Solution
- 15.8.3. Description
- 15.8.4. See Also
- 15.9. Checking for Waiting Input
- 15.9.1. Problem
- 15.9.2. Solution
- 15.9.3. Discussion
- 15.9.4. See Also
- 15.10. Reading Passwords
- 15.10.1. Problem
- 15.10.2. Solution
- 15.10.3. Discussion
- 15.10.4. See Also
- 15.11. Editing Input
- 15.11.1. Problem
- 15.11.2. Solution
- 15.11.3. Discussion
- 15.11.4. See Also
- 15.12. Managing the Screen
- 15.12.1. Problem
- 15.12.2. Solution
- 15.12.3. Description
- 15.12.4. See Also
- 15.13. Controlling Another Program with Expect
- 15.13.1. Problem
- 15.13.2. Solution
- 15.13.3. Discussion
- 15.13.4. See Also
- 15.14. Creating Menus with Tk
- 15.14.1. Problem
- 15.14.2. Solution
- 15.14.3. Discussion
- 15.14.4. See Also
- 15.15. Creating Dialog Boxes with Tk
- 15.15.1. Problem
- 15.15.2. Solution
- 15.15.3. Discussion
- 15.15.4. See Also
- 15.16. Responding to Tk Resize Events
- 15.16.1. Problem
- 15.16.2. Solution
- 15.16.3. Discussion
- 15.16.4. See Also
- 15.17. Removing the DOS Shell Window with Windows Perl/Tk
- 15.17.1. Problem
- 15.17.2. Solution
- 15.17.3. Description
- 15.17.4. See Also
- 15.18. Graphing Data
- 15.18.1. Problem
- 15.18.2. Solution
- 15.18.3. Discussion
- 15.18.4. See Also
- 15.19. Thumbnailing Images
- 15.19.1. Problem
- 15.19.2. Solution
- 15.19.3. Discussion
- 15.19.4. See Also
- 15.20. Adding Text to an Image
- 15.20.1. Problem
- 15.20.2. Solution
- 15.20.3. Discussion
- 15.20.4. See Also
- 15.21. Program: Small termcap Program
- 15.21.1. Description
- 15.21.2. See Also
- 15.22. Program: tkshufflepod
- 15.23. Program: graphbox
- 16. Process Management and Communication
- Introduction
- Process Creation
- Signals
- 16.1. Gathering Output from a Program
- 16.1.1. Problem
- 16.1.2. Solution
- 16.1.3. Discussion
- 16.1.4. See Also
- 16.2. Running Another Program
- 16.2.1. Problem
- 16.2.2. Solution
- 16.2.3. Discussion
- 16.2.4. See Also
- 16.3. Replacing the Current Program with a Different One
- 16.3.1. Problem
- 16.3.2. Solution
- 16.3.3. Discussion
- 16.3.4. See Also
- 16.4. Reading or Writing to Another Program
- 16.4.1. Problem
- 16.4.2. Solution
- 16.4.3. Discussion
- 16.4.4. See Also
- 16.5. Filtering Your Own Output
- 16.5.1. Problem
- 16.5.2. Solution
- 16.5.3. Discussion
- 16.5.4. See Also
- 16.6. Preprocessing Input
- 16.6.1. Problem
- 16.6.2. Solution
- 16.6.3. Discussion
- 16.6.4. See Also
- 16.7. Reading STDERR from a Program
- 16.7.1. Problem
- 16.7.2. Solution
- 16.7.3. Discussion
- 16.7.4. See Also
- 16.8. Controlling Input and Output of Another Program
- 16.8.1. Problem
- 16.8.2. Solution
- 16.8.3. Discussion
- 16.8.4. See Also
- 16.9. Controlling the Input, Output, and Error of Another Program
- 16.9.1. Problem
- 16.9.2. Solution
- 16.9.3. Discussion
- 16.9.4. See Also
- 16.10. Communicating Between Related Processes
- 16.10.1. Problem
- 16.10.2. Solution
- 16.10.3. Discussion
- 16.10.4. See Also
- 16.11. Making a Process Look Like a File with Named Pipes
- 16.11.1. Problem
- 16.11.2. Solution
- 16.11.3. Discussion
- 16.11.4. See Also
- 16.12. Sharing Variables in Different Processes
- 16.12.1. Problem
- 16.12.2. Solution
- 16.12.3. Discussion
- 16.12.4. See Also
- 16.13. Listing Available Signals
- 16.13.1. Problem
- 16.13.2. Solution
- 16.13.3. Discussion
- 16.13.4. See Also
- 16.14. Sending a Signal
- 16.14.1. Problem
- 16.14.2. Solution
- 16.14.3. Discussion
- 16.14.4. See Also
- 16.15. Installing a Signal Handler
- 16.15.1. Problem
- 16.15.2. Solution
- 16.15.3. Discussion
- 16.15.4. See Also
- 16.16. Temporarily Overriding a Signal Handler
- 16.16.1. Problem
- 16.16.2. Solution
- 16.16.3. Discussion
- 16.16.4. See Also
- 16.17. Writing a Signal Handler
- 16.17.1. Problem
- 16.17.2. Solution
- 16.17.3. Discussion
- 16.17.4. See Also
- 16.18. Catching Ctrl-C
- 16.18.1. Problem
- 16.18.2. Solution
- 16.18.3. Discussion
- 16.18.4. See Also
- 16.19. Avoiding Zombie Processes
- 16.19.1. Problem
- 16.19.2. Solution
- 16.19.3. Discussion
- 16.19.4. See Also
- 16.20. Blocking Signals
- 16.20.1. Problem
- 16.20.2. Solution
- 16.20.3. Discussion
- 16.20.4. See Also
- 16.21. Timing Out an Operation
- 16.21.1. Problem
- 16.21.2. Solution
- 16.21.3. Discussion
- 16.21.4. See Also
- 16.22. Turning Signals into Fatal Errors
- 16.22.1. Problem
- 16.22.2. Solution
- 16.22.3. Discussion
- 16.22.4. See Also
- 16.23. Program: sigrand
- Introduction
- 17. Sockets
- Introduction
- 17.1. Writing a TCP Client
- 17.1.1. Problem
- 17.1.2. Solution
- 17.1.3. Discussion
- 17.1.4. See Also
- 17.2. Writing a TCP Server
- 17.2.1. Problem
- 17.2.2. Solution
- 17.2.3. Discussion
- 17.2.4. See Also
- 17.3. Communicating over TCP
- 17.3.1. Problem
- 17.3.2. Solution
- 17.3.3. Discussion
- 17.3.4. See Also
- 17.4. Setting Up a UDP Client
- 17.4.1. Problem
- 17.4.2. Solution
- 17.4.3. Discussion
- 17.4.4. See Also
- 17.5. Setting Up a UDP Server
- 17.5.1. Problem
- 17.5.2. Solution
- 17.5.3. Discussion
- 17.5.4. See Also
- 17.6. Using Unix Domain Sockets
- 17.6.1. Problem
- 17.6.2. Solution
- 17.6.3. Discussion
- 17.6.4. See Also
- 17.7. Identifying the Other End of a Socket
- 17.7.1. Problem
- 17.7.2. Solution
- 17.7.3. Discussion
- 17.7.4. See Also
- 17.8. Finding Your Own Name and Address
- 17.8.1. Problem
- 17.8.2. Solution
- 17.8.3. Discussion
- 17.8.4. See Also
- 17.9. Closing a Socket After Forking
- 17.9.1. Problem
- 17.9.2. Solution
- 17.9.3. Discussion
- 17.9.4. See Also
- 17.10. Writing Bidirectional Clients
- 17.10.1. Problem
- 17.10.2. Solution
- 17.10.3. Discussion
- 17.10.4. See Also
- 17.11. Forking Servers
- 17.11.1. Problem
- 17.11.2. Solution
- 17.11.3. Discussion
- 17.11.4. See Also
- 17.12. Pre-Forking Servers
- 17.12.1. Problem
- 17.12.2. Solution
- 17.12.3. Discussion
- 17.12.4. See Also
- 17.13. Non-Forking Servers
- 17.13.1. Problem
- 17.13.2. Solution
- 17.13.3. Discussion
- 17.13.4. See Also
- 17.14. Multitasking Server with Threads
- 17.14.1. Problem
- 17.14.2. Solution
- 17.14.3. Discussion
- 17.14.4. See Also
- 17.15. Writing a Multitasking Server with POE
- 17.15.1. Problem
- 17.15.2. Solution
- 17.15.3. Solution
- 17.15.4. See Also
- 17.16. Writing a Multihomed Server
- 17.16.1. Problem
- 17.16.2. Solution
- 17.16.3. Discussion
- 17.16.4. See Also
- 17.17. Making a Daemon Server
- 17.17.1. Problem
- 17.17.2. Solution
- 17.17.3. Discussion
- 17.17.4. See Also
- 17.18. Restarting a Server on Demand
- 17.18.1. Problem
- 17.18.2. Solution
- 17.18.3. Discussion
- 17.18.4. See Also
- 17.19. Managing Multiple Streams of Input
- 17.19.1. Problem
- 17.19.2. Solution
- 17.19.3. Discussion
- 17.19.4. See Also
- 17.20. Program: backsniff
- 17.21. Program: fwdport
- 17.21.1. See Also
- 18. Internet Services
- Introduction
- 18.1. Simple DNS Lookups
- 18.1.1. Problem
- 18.1.2. Solution
- 18.1.3. Discussion
- 18.1.4. See Also
- 18.2. Being an FTP Client
- 18.2.1. Problem
- 18.2.2. Solution
- 18.2.3. Discussion
- 18.2.4. See Also
- 18.3. Sending Mail
- 18.3.1. Problem
- 18.3.2. Solution
- 18.3.3. Discussion
- 18.3.4. See Also
- 18.4. Reading and Posting Usenet News Messages
- 18.4.1. Problem
- 18.4.2. Solution
- 18.4.3. Discussion
- 18.4.4. See Also
- 18.5. Reading Mail with POP3
- 18.5.1. Problem
- 18.5.2. Solution
- 18.5.3. Discussion
- 18.5.4. See Also
- 18.6. Simulating Telnet from a Program
- 18.6.1. Problem
- 18.6.2. Solution
- 18.6.3. Discussion
- 18.6.4. See Also
- 18.7. Pinging a Machine
- 18.7.1. Problem
- 18.7.2. Solution
- 18.7.3. Discussion
- 18.7.4. See Also
- 18.8. Accessing an LDAP Server
- 18.8.1. Problem
- 18.8.2. Solution
- 18.8.3. Discussion
- 18.8.4. See Also
- 18.9. Sending Attachments in Mail
- 18.9.1. Problem
- 18.9.2. Solution
- 18.9.3. Discussion
- 18.9.4. See Also
- 18.10. Extracting Attachments from Mail
- 18.10.1. Problem
- 18.10.2. Solution
- 18.10.3. Discussion
- 18.10.4. See Also
- 18.11. Writing an XML-RPC Server
- 18.11.1. Problem
- 18.11.2. Solution
- 18.11.3. Discussion
- 18.11.4. See Also
- 18.12. Writing an XML-RPC Client
- 18.12.1. Problem
- 18.12.2. Solution
- 18.12.3. Discussion
- 18.12.4. See Also
- 18.13. Writing a SOAP Server
- 18.13.1. Problem
- 18.13.2. Solution
- 18.13.3. Discussion
- 18.13.4. See Also
- 18.14. Writing a SOAP Client
- 18.14.1. Problem
- 18.14.2. Solution
- 18.14.3. Discussion
- 18.14.4. See Also
- 18.15. Program: rfrm
- 18.16. Program: expn and vrfy
- 19. CGI Programming
- Introduction
- Architecture
- Behind the Scenes
- Security
- HTML and Forms
- Web-Related Resources
- 19.1. Writing a CGI Script
- 19.1.1. Problem
- 19.1.2. Solution
- 19.1.3. Discussion
- 19.1.4. See Also
- 19.2. Redirecting Error Messages
- 19.2.1. Problem
- 19.2.2. Solution
- 19.2.3. Discussion
- 19.2.4. See Also
- 19.3. Fixing a 500 Server Error
- 19.3.1. Problem
- 19.3.2. Solution
- 19.3.3. Discussion
- 19.3.3.1. Make sure the web server can run the script
- 19.3.3.2. Make sure the script has permissions to do what it's trying to do
- 19.3.3.3. Is the script valid Perl?
- 19.3.3.4. Is the script upholding its end of the CGI protocol?
- 19.3.3.5. Asking for help elsewhere
- 19.3.4. See Also
- 19.4. Writing a Safe CGI Program
- 19.4.1. Problem
- 19.4.2. Solution
- 19.4.3. Discussion
- 19.4.4. See Also
- 19.5. Executing Commands Without Shell Escapes
- 19.5.1. Problem
- 19.5.2. Solution
- 19.5.3. Discussion
- 19.5.4. See Also
- 19.6. Formatting Lists and Tables with HTML Shortcuts
- 19.6.1. Problem
- 19.6.2. Solution
- 19.6.3. Discussion
- 19.6.4. See Also
- 19.7. Redirecting to a Different Location
- 19.7.1. Problem
- 19.7.2. Solution
- 19.7.3. Discussion
- 19.7.4. See Also
- 19.8. Debugging the Raw HTTP Exchange
- 19.8.1. Problem
- 19.8.2. Solution
- 19.8.3. Discussion
- 19.8.4. See Also
- 19.9. Managing Cookies
- 19.9.1. Problem
- 19.9.2. Solution
- 19.9.3. Discussion
- 19.9.4. See Also
- 19.10. Creating Sticky Widgets
- 19.10.1. Problem
- 19.10.2. Solution
- 19.10.3. Discussion
- 19.10.4. See Also
- 19.11. Writing a Multiscreen CGI Script
- 19.11.1. Problem
- 19.11.2. Solution
- 19.11.3. Discussion
- 19.11.4. See Also
- 19.12. Saving a Form to a File or Mail Pipe
- 19.12.1. Problem
- 19.12.2. Solution
- 19.12.3. Discussion
- 19.12.4. See Also
- 19.13. Program: chemiserie
- Introduction
- 20. Web Automation
- Introduction
- 20.1. Fetching a URL from a Perl Script
- 20.1.1. Problem
- 20.1.2. Solution
- 20.1.3. Discussion
- 20.1.4. See Also
- 20.2. Automating Form Submission
- 20.2.1. Problem
- 20.2.2. Solution
- 20.2.3. Discussion
- 20.2.4. See Also
- 20.3. Extracting URLs
- 20.3.1. Problem
- 20.3.2. Solution
- 20.3.3. Discussion
- 20.3.4. See Also
- 20.4. Converting ASCII to HTML
- 20.4.1. Problem
- 20.4.2. Solution
- 20.4.3. Discussion
- 20.4.4. See Also
- 20.5. Converting HTML to ASCII
- 20.5.1. Problem
- 20.5.2. Solution
- 20.5.3. Discussion
- 20.5.4. See Also
- 20.6. Extracting or Removing HTML Tags
- 20.6.1. Problem
- 20.6.2. Solution
- 20.6.3. Discussion
- 20.6.4. See Also
- 20.7. Finding Stale Links
- 20.7.1. Problem
- 20.7.2. Solution
- 20.7.3. Discussion
- 20.7.4. See Also
- 20.8. Finding Fresh Links
- 20.8.1. Problem
- 20.8.2. Solution
- 20.8.3. Discussion
- 20.8.4. See Also
- 20.9. Using Templates to Generate HTML
- 20.9.1. Problem
- 20.9.2. Solution
- 20.9.3. Discussion
- 20.9.4. See Also
- 20.10. Mirroring Web Pages
- 20.10.1. Problem
- 20.10.2. Solution
- 20.10.3. Discussion
- 20.10.4. See Also
- 20.11. Creating a Robot
- 20.11.1. Problem
- 20.11.2. Solution
- 20.11.3. Discussion
- 20.11.4. See Also
- 20.12. Parsing a Web Server Log File
- 20.12.1. Problem
- 20.12.2. Solution
- 20.12.3. Discussion
- 20.12.4. See Also
- 20.13. Processing Server Logs
- 20.13.1. Problem
- 20.13.2. Solution
- 20.13.3. Discussion
- 20.13.4. See Also
- 20.14. Using Cookies
- 20.14.1. Problem
- 20.14.2. Solution
- 20.14.3. Discussion
- 20.14.4. See Also
- 20.15. Fetching Password-Protected Pages
- 20.15.1. Problem
- 20.15.2. Solution
- 20.15.3. Discussion
- 20.15.4. See Also
- 20.16. Fetching https:// Web Pages
- 20.16.1. Problem
- 20.16.2. Solution
- 20.16.3. Discussion
- 20.16.4. See Also
- 20.17. Resuming an HTTP GET
- 20.17.1. Problem
- 20.17.2. Solution
- 20.17.3. Discussion
- 20.17.4. See Also
- 20.18. Parsing HTML
- 20.18.1. Problem
- 20.18.2. Solution
- 20.18.3. Discussion
- 20.18.4. See Also
- 20.19. Extracting Table Data
- 20.19.1. Problem
- 20.19.2. Solution
- 20.19.3. Discussion
- 20.19.4. See Also
- 20.20. Program: htmlsub
- 20.21. Program: hrefsub
- 21. mod_perl
- Introduction
- Handlers
- Apache Phases
- More Documentation
- mod_perl 2
- 21.1. Authenticating
- 21.1.1. Problem
- 21.1.2. Solution
- 21.1.3. Description
- 21.1.4. See Also
- 21.2. Setting Cookies
- 21.2.1. Problem
- 21.2.2. Solution
- 21.2.3. Description
- 21.2.4. See Also
- 21.3. Accessing Cookie Values
- 21.3.1. Problem
- 21.3.2. Solution
- 21.3.3. Discussion
- 21.3.4. See Also
- 21.4. Redirecting the Browser
- 21.4.1. Problem
- 21.4.2. Solution
- 21.4.3. Discussion
- 21.4.4. See Also
- 21.5. Interrogating Headers
- 21.5.1. Problem
- 21.5.2. Solution
- 21.5.3. Discussion
- 21.5.4. See Also
- 21.6. Accessing Form Parameters
- 21.6.1. Problem
- 21.6.2. Solution
- 21.6.3. Discussion
- 21.6.4. See Also
- 21.7. Receiving Uploaded Files
- 21.7.1. Problem
- 21.7.2. Solution
- 21.7.3. Discussion
- 21.7.4. See Also
- 21.8. Speeding Up Database Access
- 21.8.1. Problem
- 21.8.2. Solution
- 21.8.3. Discussion
- 21.8.4. See Also
- 21.9. Customizing Apache's Logging
- 21.9.1. Problem
- 21.9.2. Solution
- 21.9.3. Discussion
- 21.9.4. See Also
- 21.10. Transparently Storing Information in URLs
- 21.10.1. Problem
- 21.10.2. Solution
- 21.10.3. Discussion
- 21.10.4. See Also
- 21.11. Communicating Between mod_perl and PHP
- 21.11.1. Problem
- 21.11.2. Solution
- 21.11.3. Discussion
- 21.11.4. See Also
- 21.12. Migrating from CGI to mod_perl
- 21.12.1. Problem
- 21.12.2. Solution
- 21.12.3. Discussion
- 21.12.4. See Also
- 21.13. Sharing Information Between Handlers
- 21.13.1. Problem
- 21.13.2. Solution
- 21.13.3. Discussion
- 21.13.4. See Also
- 21.14. Reloading Changed Modules
- 21.14.1. Problem
- 21.14.2. Solution
- 21.14.3. Discussion
- 21.14.4. See Also
- 21.15. Benchmarking a mod_perl Application
- 21.15.1. Problem
- 21.15.2. Solution
- 21.15.3. Discussion
- 21.15.4. See Also
- 21.16. Templating with HTML::Mason
- 21.16.1. Problem
- 21.16.2. Solution
- 21.16.3. Discussion
- 21.16.3.1. Configuration
- 21.16.3.2. Basic Mason syntax
- 21.16.3.3. Objects
- 21.16.3.4. Autohandlers
- 21.16.3.5. Dhandlers
- 21.16.4. See Also
- 21.17. Templating with Template Toolkit
- 21.17.1. Problem
- 21.17.2. Solution
- 21.17.3. Discussion
- 21.17.3.1. Configuration
- 21.17.3.2. Syntax
- 21.17.3.3. Perl code
- 21.17.3.4. Data structures
- 21.17.3.5. Subroutines
- 21.17.3.6. Including other templates
- 21.17.3.7. Parameters
- 21.17.3.8. Plug-ins
- 21.17.4. See Also
- Introduction
- 22. XML
- Introduction
- Syntax
- XML Declaration
- Processing Instructions
- Comments
- CDATA
- Well-Formed XML
- Schemas
- Namespaces
- Transformations
- Paths
- History of Perl and XML
- Further Reading
- 22.1. Parsing XML into Data Structures
- 22.1.1. Problem
- 22.1.2. Solution
- 22.1.3. Discussion
- 22.1.4. See Also
- 22.2. Parsing XML into a DOM Tree
- 22.2.1. Problem
- 22.2.2. Solution
- 22.2.3. Discussion
- 22.2.4. See Also
- 22.3. Parsing XML into SAX Events
- 22.3.1. Problem
- 22.3.2. Solution
- 22.3.3. Discussion
- 22.3.4. See Also
- 22.4. Making Simple Changes to Elements or Text
- 22.4.1. Problem
- 22.4.2. Solution
- 22.4.3. Discussion
- 22.4.4. See Also
- 22.5. Validating XML
- 22.5.1. Problem
- 22.5.2. Solution
- 22.5.3. Discussion
- 22.5.4. See Also
- 22.6. Finding Elements and Text Within an XML Document
- 22.6.1. Problem
- 22.6.2. Solution
- 22.6.3. Discussion
- 22.6.4. See Also
- 22.7. Processing XML Stylesheet Transformations
- 22.7.1. Problem
- 22.7.2. Solution
- 22.7.3. Discussion
- 22.7.4. See Also
- 22.8. Processing Files Larger Than Available Memory
- 22.8.1. Problem
- 22.8.2. Solution
- 22.8.3. Discussion
- 22.8.4. See Also
- 22.9. Reading and Writing RSS Files
- 22.9.1. Problem
- 22.9.2. Solution
- 22.9.3. Discussion
- 22.9.4. See Also
- 22.10. Writing XML
- 22.10.1. Problem
- 22.10.2. Solution
- 22.10.3. Discussion
- 22.10.4. See Also
- Introduction
- About the Authors
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OReilly