Perl: The Complete Reference

Overview

Master Perl - the multi-platform, flexible scripting language - with help from this reference. Programming expert Martin Brown shows you how to write portable Perl scripts that can be used to report on text files, handle complex data structures, enhance the user interface, program for the Web, and much more. Plus, you'll learn to deploy Perl programs across all platforms.

"...covers everything from the basics to advanced programming to extending Perl to cross-platform use... CD-ROM contains code from ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (20) from $1.99   
  • New (2) from $35.87   
  • Used (18) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$35.87
Seller since 2007

Feedback rating:

(820)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
2001-01-23 Paperback New NEW. NO remainder markings. A brand new book perfect inside and out.

Ships from: Midland, VA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$105.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

Master Perl - the multi-platform, flexible scripting language - with help from this reference. Programming expert Martin Brown shows you how to write portable Perl scripts that can be used to report on text files, handle complex data structures, enhance the user interface, program for the Web, and much more. Plus, you'll learn to deploy Perl programs across all platforms.

"...covers everything from the basics to advanced programming to extending Perl to cross-platform use... CD-ROM contains code from the book, sample scripts, and applications."

Read More Show Less

Editorial Reviews

Booknews
Multi-platform programmer Brown has written more extensive references for the programming language, but here offers a handbook to be kept on the desk for quick reference. He outlines the fundamentals, the features and syntax of all the functions, the standard library, the executive environment, and the compiler and debugger. He also provides sample scripts and an annotated bibliography. Annotation c. Book News, Inc., Portland, OR (booknews.com)
Read More Show Less

Product Details

  • ISBN-13: 9780072129502
  • Publisher: McGraw-Hill Companies, The
  • Publication date: 1/23/2001
  • Series: Complete Reference Series
  • Edition description: 2 ED
  • Edition number: 2
  • Pages: 1207
  • Product dimensions: 7.38 (w) x 9.10 (h) x 2.44 (d)

Read an Excerpt

Chapter 1: Perl Backgrounder

Main Perl Features

Perl contains many features that most Perl programmers do not even know about, let alone use. Some of the most basic features are described here.

Perl Is Free

It may not seem like a major feature, but, in fact, being free is very important. Some languages, such as C (which is free with compilers such as GNU's gcc), have been commercialized by Metrowerks, Microsoft, and other companies. Other languages, such as Visual Basic, are entirely commercial. Perl's source code is open and freeanybody can download the C source that constitutes a Perl interpreter. Furthermore, you can easily extend the core functionality of Perl both within the realms of the interpreted language and by modifying the Perl source code.

Perl Is Simple to Learn, Concise, and Easy to Read

Because of its history and roots, most people with any programming experience will be able to program with Perl. It has a syntax similar to C and shell script, among others, but with a less restrictive format. Most programs are quicker to write in Perl because of its use of built-in functions and a huge standard and contributed library. Most programs are also quicker to execute than other languages because of Perl's internal architecture (see the section, "Perl is Fast" that follows). Perl can be easy to read, because the code can be written in a clear and concise format that almost reads like an English sentence. Unfortunately, Perl also has a bad habit of looking a bit like line noise to uninitiated. Whether or not your Perl looks good and clean really depends on how you format it-good Perl is easy read. It is also worth reading the Perlstyle guidelines (in the Perl style manual page that comes with Perl) to see how Larry Wall, Perl's creator, likes things done.

Perl Is Fast

As we will see shortly, Perl is not an interpreter in the strictest sense-when you execute a Perl program it is actually compiled into a highly optimized language before it is executed. Compared to most scripting languages, this makes execution almost as fast as compiled C code. But, because the code is still interpreted, there is no compilation process, and applications can be written and edited much faster than with other languages, without any of the performance problems normally associated with an interpreted language.

Perl Is Extensible

You can write Perl-based packages and modules that extend the functionality of the language. You can also call external C code directly from Perl to extend the functionality further. The reverse is also true: the Perl interpreter can be incorporated directly into many languages, including C. This allows your C programs to use the functionality of the Perl interpreter without calling an external program.

Perl Has Flexible Data Types

You can create simple variables that contain text or numbers, and Perl will treat the variable data accordingly at the time it is used. This means that unlike C, you don't have to worry about converting text and numbers, and you can embed and merge strings without requiring external functions to concatenate or combine the results. You can also handle arrays of values as simple lists, as typical indexed arrays, and even as stacks of information. You can also create associative arrays (otherwise known as hashes) which allow you to refer to the items in the array by a unique string, rather than a simple number. Finally, Perl also supports references, and through references objects. References allow you to create complex data structures made up of a combination of hashes, lists and scalars.

Perl Is Object Oriented

Perl supports all of the object-oriented features-inheritance, polymorphism, and encapsulation. There are no restrictions on when or where you make use of objectoriented features. There is no boundary as there is with C and C++.

Perl Is Collaborative

There is a huge network of Perl programmers worldwide. Most programmers supply, and use, the modules and scripts available via CPAN, the Comprehensive Perl Archive Network (see Web Appendix B at www.osborne.com). This is a repository of the best modules and scripts available. Using an existing prewritten module can save you hundreds, perhaps even thousands, of hours of development time.

Compiler or Interpreter

Different languages work in different ways; they are either compiled or interpreted. A program in a compiled language is translated from the original source into a platformspecific machine code. This machine code is referred to as an executable. There is no direct relation between the machine code and the original source: it is not possible to reverse the compilation process and produce the source code. This means that the compiled executable is safe from intellectual property piracy.

With an interpreted language, on the other hand, the interpreter reads the original source code and interprets each of the statements in order to perform the different operations. The source code is therefore executed at run time. This has some advantages: Because there is no compilation process, the development of interpreted code should be significantly quicker. Interpreted code also tends to be smaller and easier to distribute. The disadvantages are that the original source must be supplied in order to execute the program, and an interpreted program is generally slower than a compiled executable because of the way the code is executed.

Perl fits neither of these descriptions in the real sense. The internals of Perl are such that at the time of executing a Perl script, the individual elements of the script are compiled into a tree of opcodes. Opcodes are similar in concept to machine code-the binary format required by the processor in your machine. However, whereas machine code is executed directly by hardware, opcodes are executed by a Perl virtual machine. The opcodes are highly optimized objects designed to perform a specific function. When the script is executed you are essentially executing compiled C code, translated from the Perl source. This enables Perl to provide all the advantages of a scripting language while offering the fast execution of a compiled program. This mode of operation-translation and then execution by a virtual machine is actually how most modern scripting languages work, including Java (using Just In Time technology) and Python.

Keeping all of that in mind, however, there have been some advances in the most recent versions of a Perl compiler that takes native Perl scripts and converts them into directly executable machine code. We'll cover the compiler and Perl internals later in this book.

Similar Programming Languages

We already know that Perl has its history in a number of different languages. It shares several features and abilities with many of the standard tools supplied with any Unix workstation. It also shares some features and abilities with many related languages, even if it doesn't necessarily share the same heritage.

With regard to specific features, abilities, and performance, Perl compares favorably against some languages and less favorably against others. A lot of the advantages and disadvantages are a matter of personal preference. For example, for text handling, there is very little to choose between awk and Perl. However, personally I prefer Perl for those tasks that involve file handling directly within the code, and awk when using it as a filter as part of a shell script.

Unix Shells

Any of the Unix shells-sh, csh, ksh, or even bash-share the same basic set of facilities. They are particularly good at running external programs and at most forms of file management where the shell's ability to work directly with many of the standard Unix utilities enables rapid development of systems management tools.

However, where most shells fail is in their variable- and data-handling routines. In nearly all cases you need to use the facilities provided by shell tools such as cut, paste, and sort to achieve the same level of functionality as that provided natively by Perl...

Read More Show Less

Table of Contents

1 Perl Backgrounder 3
2 Perl Basics 15
3 The User Interface 53
4 Data Manipulation 83
5 Subroutines, Packages, and Modules 119
6 Managing Files, Users, Groups, and Time 143
7 Using Data Structures 175
8 Database Systems 241
9 Networking 279
10 Interprocess Communication 313
11 Advanced Execution Methods 343
12 Making Perl More User Friendly 369
13 Advanced User Interfaces 395
14 The Web Environment 431
15 Web Programming 453
16 Under the Hood 471
17 Extending and Embedding Perl 513
18 Debugging 577
19 Perl Compiler 613
20 Perl Makefiles 643
21 Perl Under Unix 665
22 Perl Under Windows 95/98/NT/2000 671
23 Perl Under MacOS 761
24 Writing a Cross-Platform Script 783
25 Things You Never Knew You Could Do with Perl 807
A Resources 831
B Function Reference 839
C Perl Entity Reference 925
D Errors and Warnings 933
E Standard Perl Library 999
F CPAN Module Reference 1141
Index 1159
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)