BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?

Advanced Perl Programming

By Sriram Srinivasan
August 1997
Pages: 430
ISBN 10: 1-56592-220-4 | ISBN 13: 9781565922204
starstarstarstarstar (Average of 6 Customer Reviews)

This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.

The latest edition is also available on Safari Books Online.

Book description

This book covers complex techniques for managing production-ready Perl programs and explains methods for manipulating data and objects that may have looked like magic before. It gives you necessary background for dealing with networks, databases, and GUIs, and includes a discussion of internals to help you program more efficiently and embed Perl within C or C within Perl.
Full Description

So you've learned Perl, but you're getting frustrated. Perhaps you've taken on a larger project than the ones you're used to. Or you want to add a user interface or a networking component. Or you need to do more complicated error trapping. Whether your knowledge of Perl is casual or deep, this book will make you a more accomplished programmer. Here you can learn the complex techniques for production-ready Perl programs. This book explains methods for manipulating data and objects that may have looked like magic before. Furthermore, it sets Perl in the context of a larger environment, giving you the background you need for dealing with networks, databases, and GUIs. The discussion of internals helps you program more efficiently and embed Perl within C or C within Perl. Major topics covered include:
  • Practical use of packages and classes (object-oriented programming)
  • Complex data structures
  • Persistence (e.g., using a database)
  • Networking
  • Graphical interfaces, using the Tk toolkit
  • Interaction with C language functions
  • Embedding and extending the Perl interpreter
In addition, the book patiently explains all sorts of language details you've always wanted to know more about, such as the use of references, trapping errors through the eval operator, non-blocking I/O, when closures are helpful, and using ties to trigger actions when data is accessed. You will emerge from this book a better hacker, and a proud master of Perl.

Browse within this book

Cover | Table of Contents | Colophon




Featured customer reviews

Write a Review


Frustrating examples,  January 03 2005
Rating: StarStarStarStarStar
Submitted by Anonymous Reader   [Respond | View]

I'm not far into the book, and make no mistake, I AM learning. I'd like to give the book 5 stars for content and 0 for the examples. I had to settle for an average of three.

Having subroutines presented without the calling syntax has made things much more difficult for me than I think they need to be. For example, see the matrix manipulation functions in Chapter 2.

To make matters worse, these examples aren't in the downloadable code examples.


Advanced Perl Programming Review,  March 24 2004
Rating: StarStarStarStarStar
Submitted by Michal   [Respond | View]

Nice book.

It takes the time and effort to de-mistify many troublesome spots. It integrates details from different scripting and system languages to give a very well rounded overview of state of the art. It covers

a miriad of topics, all of which add to the value of the book.

Advanced Perl Programming Review,  February 29 2004
Rating: StarStarStarStarStar
Submitted by .   [
Respond | View]

At first - its very good readeble and clear! It gives you necessary background for dealing with networks, databases, and GUIs, which is important for me. But if you are not much perl experienced than its not for you:-(
Kate Lea

Read all reviews


Advanced Perl Programming Review,  September 25 2003
Rating: StarStarStarStarStar
Submitted by Richard Reppert   [Respond | View]



I would have to agree that the lack of functional examples does cloud the quality of this book. The text is good, but not having functional examples leaves the complication of whether we should do what the text say or what the example does.

Now I am the first to admit that errors occur. That is what code downloads and errata are supposed to fix. Not only does the code download from www.oreily.com not fix some problems, but does not even include all of the examples present in the book.

As a learning book where you are going to read all the details, the book is good. As a "quck grab it" reference this book fails because of the errors.




Advanced Perl Programming Review,  June 11 2003
Rating: StarStarStarStarStar
Submitted by Henning Petersen   [Respond | View]

A very good computer book! Notice: you don't have to read 5 chapters about 'the if-then', 'the for-next' and such stuff that normally is a drag if you ever touched a computer before.


Advanced Perl Programming Review,  October 02 2001
Rating: StarStarStarStarStar
Submitted by Anonymous Coward   [Respond | View]

Watch out for the Networking: Implementing RPC chapter! There are myriad errors in the code examples. Why doesn't someone review the code, and perhaps actually try to run it?

For example:

The peer demonstration (between two RPC servers) just won't work. Besides the fact that the code has a typo (new_rpc_server instead of new_server, mentioned in the errata), they each create a listening socket, supposedly to each opposite machine. That *won't* work. Even if they created a listening socket on their respective hosts, they wouldn't know who to contact for the TCP connection. The lower-level Msg library doesn't facilitate a server sending messages to some arbitrary client (as the RPC example implies).

Someone should *really* sit and go through the code.

Want another more explicit example:

BEGIN EXCERPT

sub rpc {

my $conn = shift;

my $subname = shift;

$subname = (caller() . '::' . $subname) unless $subname =~ /:/;

my $gimme = wantarray ? 'a' : 's'; # Array or scalar

my $msg_id = ++$g_msg_id;

my $serialized_msg = freeze ('>', $msg_id, $gimme, @_);

END EXCERPT

Notice that he shifts subname off the param list? Then proceeds to build the $serialized_msg with only the @_ params (NOT INCLUDING THE SUBNAME).

This is quite disasterous when the recevier gets here:

BEGIN EXCERPT

my $instant = thaw($msg);

my ($dir, $id, @args) = @$instant;

my ($result, @results);

if ($dir eq '>') {

# New request message

my $gimme = shift @args;

my $sub_name = shift @args;

try {

no strict 'refs'; # Because we call the subroutine using

# a symbolic reference

if ($gimme eq 'a') { # Want an array back

@results = &{$sub_name} (@args);

} else {

$result = &{$sub_name} (@args);

}

END EXCERPT

Notice again that he tries to shift the subname off the thaw'd @args array... Won't work, will it?!

I knew this already but for your knowledge - Don't trust ANYONE else's code. You'll pay for it with a significant loss of time.


Advanced Perl Programming Review,  January 20 2000
Submitted by Christian Lemburg   [Respond | View]



Very good for intermediate level Perl users or experienced programmers interested in Perl. Nice lessons to pick up on comparing different design approaches to various problems. Just at the beginning the author lists some books that influenced him. After reading through the list I'd say this book is worth buying for this recommendation list alone.


Advanced Perl Programming Review,  June 16 1999
Submitted by Asgeir Høydalsvik   [Respond | View]



I learned alot reading this book, but when I was
to use the module 'ObjectTemplate' in the examples,
I found out that it didn't work. The testing was
not sufficient to discover the error in that module.

The book is worth reading, but the modules presented
does not nessesarily work.




Advanced Perl Programming Review,  January 22 1999
Submitted by Buddachile   [Respond | View]



This book teaches valuable Perl programming
techniques using clear and precise language.
Outstanding!


Advanced Perl Programming Review,  October 24 1998
Submitted by Mike T.   [Respond | View]



Excellent book. It takes the time and effort to de-mistify many troublesome spots. It integrates details from different scripting and system languages to give a very well rounded overview of state of the art. It covers
a miriad of topics, all of which add to the value of the book. I especially like chapters on Persistence, Networking and C<->Perl interaction.


Advanced Perl Programming Review,  September 06 1998
Submitted by Steve Troxel   [Respond | View]



Great Book. Very readable, clear, and interesting !


Advanced Perl Programming Review,  August 20 1998
Submitted by Morgan Nilsson, Linköping, Sweden   [Respond | View]



The two chapters on object orientation are great. It really
increased my abiliy to create classes in perl. Good examples
and comparison to other languages (Python, Tcl, Java and
C++).

The book gave me a deeper look at perl internals. It's
very good to know when trying to write better and faster
code. I could never guess it was that easy...

Seeing so much advanced code made my fears go away and now
I have the courage to take full advantage of perl strength!


Advanced Perl Programming Review,  May 25 1998
Submitted by Mark Daku   [Respond | View]



Finally a book that an advanced person can use. Very
nice coverage and an excellent companion to Programming
Perl. One issue I have is the lack of coverage of on
Streams, something I find increasingly useful.

A must buy for the Intermediate to Advanced perl programmer.

Looking forward to the next edition when threads are main-
stream. (That's a hint ;-) )




Media reviews
"This book covers complex techniques for managing production-ready Perl programs and explains methods for manipulating data and objects that may have looked like magic before. It gives you necessary background for dealing with networks, databases, and GUIs, and includes a discussion of internals to help you program more efficiently and embed Perl within C or C within Perl."
-- Gordon Haverland, Edmonton Linux User Group

"As with every other O'Reilly Perl book I have read (and there have been many), this is an excellent book and definitely deserves it's moniker of 'advanced'...This book will help you move from someone who only can use perl for small tasks to being able to use perl for serious software development. Encapsulation, reusability, inner workings; you got it...I was very impressed with this book and would recommend it to any seasoned perl programmer who needs to move to the next step."
--Jeremy Beker, Williamsburg Macromedia User Group, May 24, 2003
http://fsweb.wm.edu/wmmug/reviews/output.cfm?id=173

"Yet another of O'Reilly's excellent stable of Perl books. The sections on networking and object-orientation are well-nigh indispensable. It is extremely well-thumbed and occupies a spot on the shelf as close as possible to my desk."--Charlie Stross, Linux Format June 2001

"Excellent Book--5 stars out of 5" excellent O'Reilly books, Advanced Perl Programming, by Sriram Srinivasan, and the famous Perl Cookbook, by Tom Christiansen and Nathan Torkington, are invaluable resources for learning how to accomplish such magic with Perl."--Online, 05/01/2001

Read all reviews

See larger cover