
Computer Science & Perl Programming
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Table of Contents
- Foreword
- Preface
- Finding Perl Resources
- Conventions Used in This Book
- Comments and Questions
- Acknowledgments
- Introduction
- History of TPJ
- Computer Science and Perl Programming
- Part I
- All About Arrays
- Basics
- Positions
- Position Versus Count
- Foreach Loops
- The Reverse and Sort Functions
- Slices
- Adding and Deleting Values
- Lists to Strings and Back Again
- Putting It All Together
- Answer to the earlier question
- Perfect Programming
- Warnings with -w
- The strict Pragma
- Tainting and Safe
- Checking Return Values
- Planning for Failure
- The Perl Debugger
- The Perl Profiler
- Stack Traces
- Precedence
- What Is Precedence?
- Rules and More Rules
- An Explosion of Rules
- Precedence Traps and Surprises
- List Operators and Unary Operators
- Complete Rules of Precedence
- How to Remember All the Rules
- Quiz
- Answers
- The Birth of a One-Liner
- Comparators, Sorting, and Hashes
- Sorting
- The Simplest Way to Sort
- Tinkering with the Sort
- Sorting Hashes
- Sorting by Key
- Sorting a Hash by Value
- Sorting a Hash by Key and Value
- Efficient Sorting
- Further Reading
- What Is Truth?
- The undef Function
- Back to Truth
- Truth in Context
- Applications
- Conclusion
- Using Object-Oriented Modules
- Modules and Their Functional Interfaces
- Modules with Object-Oriented Interfaces
- Class Methods
- Object Methods
- What Can You Do with Objects?
- What's in an Object?
- What Is an Object Value?
- So Why Do Some Modules Use Objects?
- Unreal Numbers
- A Surprising Program
- The Right Way
- CryptoContext
- Context
- Prototypes
- Subroutine Calls
- Putting Them All Together
- Conclusion
- Context Is Subtle
- Prototypes Are a Mixed Blessing
- References
- Who Needs Complicated Data Structures?
- The Solution
- Making References
- Make Rule 1
- Make Rule 2
- Using References
- Use Rule 1
- Use Rule 2
- An Example
- The Arrow Rule
- Solution
- The Rest
- In Summary
- Perl Heresies
- Don't Use -w
- Don't Use Regular Expressions Just Because They're Cool
- Don't Always Use Modules
- Partial Solutions Are Okay
- Part II
- Understanding Regular Expressions, Part I
- The Story of Fred
- Reality Check
- Regular Expression Background
- DFA Versus NFA
- NFA Versus NFA, DFA Versus DFA
- Perl Regex Engine Basics
- A Sample Regex
- "The Longest Match Wins" and Other Myths
- The First Real Rule of Regexes
- A Single Match Attempt
- Multiple Paths
- Backtracking
- Options, Options, Options
- Alternation
- Character Classes
- How the Path Is Chosen
- That's Pretty Much It
- Understanding Regular Expressions, Part II
- Knowing Versus Knowing on Paper
- Will They Work at All?
- How Do They Differ?
- Which Is Best?
- Efficiency
- Greediness
- Logical "or" Versus Regex "or"
- Benchmarking
- Conclusion
- Understanding Regular Expressions, Part III
- Nibbling Strings
- The Problem
- Going on a Diet
- How Regexes Work
- Machines
- Blank Arrows
- Rules Again
- How to Turn a Regex into a Penny Machine
- What Do You Mean, Done?
- The Regex Module
- Implications for Perl
- What About Backreferences?
- Internals of Regex.pm
- Lies
- Other Directions
- Bibliography
- Part III
- Infinite Lists
- Hamming's Problem
- Streams
- Hamming's Problem Revisited
- Dataflow Programming
- Other Directions
- References
- Compression
- Morse Code
- Ambiguous Codes
- Huffman Coding
- The Code
- The Rub
- Another Rub
- Other Methods
- Other Directions
- Bibliography
- Memoization
- Recursive Functions
- The Memoize Module
- Module Internals
- Some Other Applications of Memoization
- Persistent Cache
- Profiling Execution Speed
- The Orcish Maneuver
- Dynamic Programming
- When Memoizing Doesn't Work
- Bibliography
- Parsing
- A Sample Parse
- Formal Grammars
- The Different Types of Parsers
- Bottom-Up Parsers
- Top-Down Parsers
- The Descent of RecDescent
- Building a Parser with Parse::RecDescent
- How Parse::RecDescent Works
- Handling Items
- Handling Repeated Items
- No Lexer
- Error Handling
- An In-Depth Example
- Freeform Grammar
- Parser return values
- Object-oriented parsing
- Explicit rejection
- "Inlined" subrules
- Optional and specified-repetition subrules
- Rule lookaheads
- Advanced Features of Parse::RecDescent
- Automated Error Reporting
- Integrated Tracing Facilities
- Position Information Within Actions
- Parse Tree Pruning
- Argument passing and generic rules
- Deferred Actions
- Extensible Grammars
- Practical Applications of Parsing
- Limitations of Parse::Recdescent
- No Left-Recursion
- Coming Attractions
- More Information
- Acknowledgments
- Trees and Game Trees
- What Is a Tree?
- Formal Definition
- Markup Language Trees
- Building Your Own Trees
- An Implementation: Game Trees for Alak
- Digression: Links to Parents
- Recursively Printing the Tree
- Growing the Tree
- References
- B-Trees
- A Review of Binary Trees
- The Problem with Binary Trees
- B-Trees Are Always Balanced
- A Guided Tour of the Program
- Moving Down
- Moving Up
- Details
- Other Directions
- Bibliography
- Making Life and Death Decisions with Perl
- Probability Theory
- Whoa!
- Perl
- Last Words
- Information Retrieval
- Text Searches on Manual Pages
- The Implementation
- Relevance Feedback
- "Advanced" Search Operators
- Conclusion
- References
- Randomness
- Congruential Generators
- Choosing the Seed
- LFSRs
- References
- Random Number Generators and XS
- Random Versus Pseudorandom Numbers
- Linear Congruential Generators Revisited
- It's Not That Bad
- It's Not Good, Either
- A Better Generator for Perl
- Bridging C and Perl with XS
- XS Overview
- Types and the Typemap
- Acknowledgments
- References
- Part IV
- Suffering from Buffering
- What Is Buffering?
- Surprise!
- Disabling Inappropriate Buffering
- Hot and Not Hot
- Other Perils of Buffering
- "My Output Is Coming Out in the Wrong Order!"
- "My Web Server Says I Didn't Send the Right Headers, but I'm Sure I Did!"
- "I'm Trying to Send Data over the Network, but Nothing Is Sent!"
- "When My Program Terminates Abnormally, the Output Is Incomplete!"
- Flushing on Command
- Other Directions
- Summary
- Scoping
- Package Variables
- The Current Package
- Package Variable Trivia
- Lexical Variables
- local and my
- What Good Is local?
- When to Use my and When to Use local
- Other Properties of my Variables
- my Variable Trivia
- Declarations
- use vars and our
- Summary
- Seven Useful Uses of local
- 1. Special Variables
- 2. Localized Filehandles
- Localized Filehandles Revisited
- Marginal Uses of Localized Filehandles
- Dirhandles
- 3. The First Class Filehandle Trick
- 4. Aliases
- 5. Dynamic Scope
- 6. Dynamic Scope Revisited
- Marginal Uses of Dynamic Scoping
- 7. Perl 4 and Other Relics
- Summary
- Parsing Command-Line Options
- Option Parsing Conventions
- The Simplest Way
- The Easy Way
- The Advanced Way
- Option Words
- Using and Bundling Single-Letter Options
- Advanced Destinations
- Other Configurations
- Help Messages
- Other Option Handling Modules
- Building a Better Hash with tie
- Introduction
- The Problem
- Discussion
- Attempted Solutions
- Check for Built-In Support
- See If a Solution Already Exists
- A Working Data Structure
- Implementation
- Implementing a Tied Hash
- Using a Tied Hash
- Testing
- Optimizations
- Time
- Space
- Making It a Module
- Summing Up
- References
- Source Filters
- Concepts
- Using Filters
- Writing a Source Filter
- Writing a Source Filter in C
- Creating a Source Filter as a Separate Executable
- Writing a Source Filter in Perl
- The Debug Filter
- Conclusion
- Overloading
- Defining Your Own Types
- Adding Methods to the Date Class
- A Minor Problem
- Introducing Overloading
- Overloading More Methods
- Overloading and Associativity
- Full Overloading Implementations
- Automatically Generating Overloaded Methods
- The Fallback Mechanism
- Overloading and Inheritance
- Limitations of Operator Overloading
- Conclusion
- References
- Building Objects Out of Arrays
- OO Basics
- Arrays Are Faster
- Arrays Use Less Space
- Arrays Can Prevent Attribute Collisions
- Arrays Can Prevent Misspellings
- Disadvantages
- Other Approaches
- Hiding Objects with Closures
- A Simple Example
- Closures
- What About Inheritance?
- Conclusion
- Multiple Dispatch in Perl
- Multiple Dispatch
- Multiple Dispatch via "Tests-in-Methods"
- Multiple Dispatch via a Table
- Initializing the Dispatch Table
- Choosing the Initialization Order
- Comparing the Two Approaches
- Dynamic Dispatch Tables
- The Costs of Extending the Dispatch Table
- Multiple Dispatch and Subroutine Overloading
- The Class::Multimethods Module
- Part V
- Using Other Languages from Perl
- Introducing Inline.pm
- A More Complex Example
- Calling C Functions from Perl
- Manipulating Perl's Stack
- How Inline Works
- Creating Perl Extensions
- Inline::Config
- XS and SWIG
- Using Perl as C's Memory Manager
- Benchmarks
- SWIG
- Hooks by Hand
- Wrapping a C Function
- Interface Files
- An In-Depth Example: Emulating top
- From %{ to %}
- After the %{ ... %} Block
- The top Emulator
- Conclusion
- Benchmarking
- The Trouble with time( )
- Better Resolution with times
- The Benchmark Module
- Example: Summing an Array
- Conclusion
- Building Software with Cons
- Make Doesn't Do the Right Thing
- Build Sequencing
- Variant Builds
- Complexity
- The Solution: Cons
- Cons Scripts Are Perl Scripts
- Cons Does the Right Thing
- Explicit and Implicit Dependencies
- MD5 Cryptographic Signatures
- Automatic, Global Sequencing of Builds
- Summary
- MakeMaker
- Reasons to Use MakeMaker
- h2xs
- Components of Makefile.PL
- A Deeper Example
- Advanced Makefile Features
- MakeMaker and Installation of Modules
- perllocal.pod
- Autoloading Perl Code
- Why Autoload?
- Using the AutoLoader
- How Autoloading Works
- AutoSplitting Your Module
- AutoLoading Scripts
- AutoLoading C Programs
- Summary
- Debugging and Devel::
- Runtime Examination of Data
- Profiling and Coverage Testing
- Reference Manipulation
- Helping C and C++ Programmers
- Rolling Your Own
- The DB:: Namespace
- Which Should You Use?
- Part VI
- Email with Attachments
- What Is MIME, and Why Do I Care?
- How Does MIME Encode Data?
- Multiple Pieces of MIME
- How to Create a Mime Message
- An Alternate Route
- A Full-Blown Example
- Conclusion
- Sending Mail Without sendmail
- Some Email Background
- A Store-and-Forward System
- There's More Than One Way to Deliver Mail
- Standards Governing Email
- The Mail Itself
- The Message Body
- The Message Headers
- The Message Envelope
- Sending Mail in Six Easy Steps
- Step One: Connecting to the Remote SMTP Server
- Step Two: Identifying Yourself
- Step Three: Identifying the Mail Sender
- Step Four: Identifying the Mail Recipients
- Step Five: Sending the Mail
- Step Six: Closing the Connection
- What Next?
- Sending Mail with Mail::Mailer
- Sending Mail with Net::SMTP
- Talking Directly to the Mail Host
- Which Should You Choose?
- Filtering Mail
- What Is It?
- A Very Simple Mail Filter
- Separating Mail into Folders
- Mail and News
- A Complete Filter
- Caveats
- Conclusion
- Net::Telnet
- The Problem
- The Solution
- Telnetting the Hard Way
- Telnetting the Easy Way
- Telnetting the Easiest Way
- Special Considerations
- Other Features
- Microsoft Office
- Background
- The Problem
- The Solution
- Wait, There's More
- Client-Server Applications
- Using the inetd Super-Daemon
- A Standalone Server
- A Threaded Server
- Launching Standalone Servers from inetd
- Further Information
- Managing Streaming Audio
- Playlists, Streams, and ID3 Tags
- Apache::MP3
- Conclusion
- A 74-Line IP Telephone
- Sound Cards and /dev/dsp
- The Simple Version
- Adding an MP3 Encoder
- Summary
- References
- Controlling Modems
- Initializing Your Modem
- Getting Your Modem to Dial
- To Block or Not to Block?
- What's Next?
- Afterword
- References
- Using Usenet from Perl
- Finding Newsgroups
- Retrieving Articles
- Posting Articles
- Transferring Files with FTP
- A Simple Example
- Multiple FTP Connections
- Transferring Files Between Servers
- Spidering an FTP Site
- Motivation
- Net::FTP
- Downloading a File (the Simple Case)
- Recursion
- Downloading a File Tree (the Recursive Case)
- Uploading a File (the Simple Case)
- Uploading a File Tree (the Recursive Case)
- Applications
- DNS Updates with Perl
- DNS Basics
- DNS Servers
- Dynamic Update
- Setting Up Your Nameserver
- Delegating the Zone
- Using Net::DNS::Update
- Paths for Futher Exploration
- Part VII
- DBI
- The Architecture of DBI
- Why DBI?
- The Modules
- Handles
- Resources
- Sample Code
- Using DBI with Microsoft Access
- The Win32-Access-ODBC-DBI::DBD Checklist:
- References
- DBI Caveats
- DBI and Loops
- Placeholders
- Fetches
- Bind Columns
- Error Checking
- Transactions
- References
- Beyond Hardcoded Database Applications with DBIx::Recordset
- CRUD Without SQL
- Sample Usage
- A DBI Version
- Conclusion
- Win32::ODBC
- Win32::ODBC Basics
- Demystifying SQL
- Installing Win32::ODBC
- Getting Started
- Debugging
- CRUD
- Transactions
- Data Sources
- Data Dictionary
- Conclusion
- Net::LDAP
- What Is LDAP?
- Setting Up an OpenLDAP Server
- Loading Data into the Directory
- A Searchable Web Interface to Manage Your Directory
- Where LDAP Is Going
- References
- Web Databases the Genome Project Way
- The ACEDB Database
- ACEDB Objects and Classes
- Accessing ACEDB from Perl
- ACEDB Meets the Web
- Registering ACEDB Displays
- Conclusions
- References
- Spreadsheet::WriteExcel
- Using Spreadsheet::WriteExcel
- How the Spreadsheet::WriteExcel Module Works
- The Excel Binary Interchange File Format
- A Brief History of Time Wasted
- The pack Programming Language
- The Structure of the Module
- Alternative Ways of Writing to Excel
- Reading from Excel
- Win32::OLE
- Obtaining Spreadsheet::WriteExcel
- References
- Part VIII
- How to Improve Perl
- Components of the Perl Distribution
- The Components of Perl
- The Core
- The Standard Library
- Configuration and Installation
- Test Suite
- Utilities
- Summary
- Basic Perl Anatomy
- How Perl Works
- Lexical Analysis
- Parsing
- Compilation
- Execution
- Perl Subsystems
- For Further Reading
- Lexical Analysis
- Tokenizing
- Perl's Lexer
- Lexer Variables
- Tokenizing Considerations
- Further Information
- Debugging Perl Programs with -D
- What -D Does for You
- Trace Execution with -Dt
- Stack Snapshots with -Ds
- Syntax Tree Dump with -Dx
- Regular Expression Parsing and Execution with -Dr
- Method and Overloading Resolution with -Do
- Context (Loop) Stack Processing with -Dl
- Tokenizing and Parsing with -Dp
- Other -D Debugging Flags
- Microperl
- Bootstrapping
- Building Microperl
- How Microperl Works
- Practical Uses for Microperl
- Problems
- Future Work
- Index
- About the Authors
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.