Home > Store

Sams Teach Yourself Perl in 24 Hours, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Sams Teach Yourself Perl in 24 Hours, 2nd Edition

eBook (Watermarked)

  • Your Price: $19.19
  • List Price: $23.99
  • About Watermarked eBooks
  • This PDF will be accessible from your Account page after purchase and requires the free Adobe® Reader® software to read it.

    The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

    Watermarked eBook FAQ


  • Copyright 2003
  • Edition: 2nd
  • eBook (Watermarked)
  • ISBN-10: 0-7686-5822-5
  • ISBN-13: 978-0-7686-5822-4

This is the eBook version of the printed book. If the print book includes a CD-ROM, this content is not included within the eBook version.

Sams Teach Yourself Perl in 24 Hours teaches readers new to Perl the necessary basics of Perl and then shows them how to apply that knowledge in real-world Web development.

The book is divided into three sections:

  • The first third of the book teaches the basics of the Perl language.
  • The second third of the book builds on this foundation, and shows the reader how to interact with the file system, operating system, and network.
  • The last third of the book focuses on Web development.It begins with the basics of CGI and then moves quickly into building common Web solutions such as data collection, multi-page forms, e-mail forms, and using Perl as a Web templating system.

Sample Content

Table of Contents

(NOTE: Each chapter concludes with a Summary, Q&A and Workshop.)



Hour 1. Getting Started with Perl.

Installing Perl. Documentation. Your First Program.

Hour 2. Perl's Building Blocks: Numbers and Strings.

Literals. Scalar Variables. Expressions and Operators. More Operators. Exercise: Interest Calculator.

Hour 3. Controlling the Program's Flow.

Blocks. The if Statement. Looping. Other Flow Control Tools. Exercise: Finding Primes.

Hour 4. Stacking Building Blocks: Lists and Arrays.

Putting Things into Lists and Arrays. Getting Elements Out of an Array. Manipulating Arrays. Exercise: Playing a Little Game.

Hour 5. Working with Files.

Opening Files. Reading. Writing. Free Files, Testing Files, and Binary Data.

Hour 6. Pattern Matching.

Simple Patterns. The Metacharacters. Substitution. Exercise: Cleaning Up Input Data. Pattern Matching Odds and Ends.

Hour 7. Hashes.

Filling Your Hash. Getting Data Out of a Hash. Lists and Hashes. Hash Odds and Ends. Useful Things to Do with a Hash. Exercise: Creating a Simple Customer Database with Perl.

Hour 8. Functions.

Creating and Calling Subroutines. Scope. Exercise: Statistics. Function Footnotes.


Hour 9. More Functions and Operators.

Searching Scalars. Transliteration, Not Substitution. A Better Way to print. Exercise: A Formatted Report. New Ways with Arrays.

Hour 10. Files and Directories.

Getting a Directory Listing. Exercise: The Unix grep. Directories. Unix Stuff. Everything You Ever Wanted to Know about THAT File. Exercise: Renaming Files En Masse.

Hour 11. System Interaction.

The system() Function. Capturing Output. Pipes. First Lesson in Portability.

Hour 12. Using Perl's Command-Line Tools.

What Is the Debugger? Exercise: Finding the Bug. Other Command-Line Stuff.

Hour 13. References and Structures.

Reference Basics. Recipes for Structures. Exercise: Another Game, Maze.

Hour 14. Using Modules.

A Gentle Introduction. A Quick Tour. Full List of Standard Modules.

Hour 15. Finding Permanence.

DBM Files. Exercise: A Free-Form Memo Pad. Text Files as Databases. Random File Access. Locking.

Hour 16. The Perl Community.

What's Perl All About, Anyway? The Comprehensive Perl Archive Network (CPAN). Your Next Steps. Other Resources.


Hour 17. Introduction to CGI.

Browsing the Web. Don't Skip This Section. Your First CGI Program. What to Do When Your CGI Program Doesn't Work.

Hour 18. Basic Forms.

How Forms Work. Passing Information to Your CGI Program. Web Security 101. A Guestbook.

Hour 19. Complex Forms.

The Stateless Web. Hidden Fields. A Multipage Survey.

Hour 20. Manipulating HTTP and CGI.

The HTTP Conversation. More Details on Calling CGI Programs. Server-Side Includes. Looking Out the Window. Redirection.

Hour 21. Cookies.

What's a Cookie? Advanced Cookie Stuff. Problems with Cookies.

Hour 22. E-mail from CGI.

A Primer in Internet Mail. A Mailing Function. Sending Mail from a Web Page.

Hour 23. Web Pages with Templates.

Templating Systems. Example: A Common Header File. Example: Managing Sessions in HTML::Mason. Example: Managing Applications in HTML::Mason.

Hour 24. Making an Interactive Site.

Hit Counters. Borrowing Content.


Installing Modules.

Picking the Right Module. Installing the Modules Under…. What to Do When You're Not Allowed to Install Modules.



Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership