Forgot your password?
Perl Books Media Programming Book Reviews IT Technology

Learning Perl Objects, References & Modules 158

Posted by timothy
from the taking-up-the-space-in-your-brain dept.
honestpuck writes "In the world of Perl there was once only the 'camel book,' held in perhaps as much reverence as 'K & R' among C programmers. It certainly appealed to roughly the same audience, those who wanted a short, sharp introduction to a programming language. It was with a problem that needed solving and a copy of the camel book that I started as a Perl programmer." Read on for honestpuck's review of another book he regards at least as highly.
Learning Perl Objects, References & Modules
author Randal L. Schwartz with Tom Phoenix
pages 205
publisher O'Reilly
rating 9.9 - Cannot find a fault
reviewer Tony Williams
ISBN 0596004788
summary Perfect book for taking your Perl skills to the next level

Then for those that wanted a introduction to Perl and programming Randal L. Schwartz wrote Learning Perl, a book that has arguably become the definitive textbook for teaching Perl. The one weakness was that it left off before really getting to the guts of building large, complex projects in Perl. It did not cover classes, objects, breaking your code up into pieces or the more arcane aspects of variables, references. For this we had to resort to the last few chapters of the 'camel book' and I, for one, have never really been totally comfortable at this end of the language; when I'm reading someone else's code it might take a couple of reads to fully understand the process.

Now this weakness has been well and truly addressed. Schwartz, with Tom Phoenix, has written "Learning Perl Objects, References & Modules", a volume that takes the same steady approach to teaching you the more advanced topics as the earlier 'Learning Perl'. Schwartz has spent the years since writing 'Learning Perl' teaching and writing. You can tell, this is a superbly written book, not that 'Learning Perl' wasn't well written; it's just that this volume is far better.

The Guts

The book starts with a chapter on building larger programs that covers @INC, eval, do and require before discussing packages and scope. It then has several chapters on references that explains in well understandable fashion and increasing complexity all the ins and outs of references including dereferencing, nested references, references to subroutines and references to anonymous data before a final chapter on references that gives you some incredibly useful tricks such as sorting and recursively defining complex data.

The book continues with three chapters that give you a solid grounding in Perl objects. Here Schwartz has assumed that you know at least a little about object oriented programming, some may feel the need for more explanation of concepts might be required, but if you've had any experience in OOP before then the clear examples and descriptions here are probably all you want.

Modules are not as well covered, with only a single chapter, but it is hard to think of anything left out, it covers using them and building your own so well that it left me wondering what all the fuss was about, "seems obvious to me." The book concludes with chapters on building a distribution out of your module, testing it using make test (with Test::Harness), Test::Simple and Test::More before a chapter telling you how to contribute to CPAN.

Each chapter of the book concludes with a number of small exercises, designed to be done in just a few minutes, that cement the learning of the previous chapter. The answers to these are at the end of the book.


Once I'd finished I felt I had a much more solid grounding in Perl, certainly I was much better able to understand another programmer's code that dealt with such things as subroutine references and some complex data structures. While the subject matter of this book is almost entirely covered in 'Programming Perl' the tutorial aspects of this book made it much easier going. The style would be familiar to anyone who has read 'Learning Perl', light without being frivolous and extremely well written, Schwartz seems a master at reducing complexity to manageable bites.

This book is deceptively easy to follow, each new idea built onto earlier ones, each new language concept introduced in an easy manner. The writing is excellent, it's hard to explain why I appreciated it so much. That may be the reason, the writing isn't forced or heavy or too light or obvious. It just allows the solid material of the book to shine through. Go to the ubiquitous O'Reilly website and grab the example chapter (the site also has a few Errata, the Table of Contents and the code from the book) and give it a look.

I think this may well become a classic, I may well in ten years time talk of Schwartz's books with the same awe I now talk of Brian Kernighan's. I'll certainly eagerly await his next book and keep this one close until it comes. Oh, and Randal, how about 'Software Tools for Perl Programmers'?

You can purchase Learning Perl Objects, References & Modules from Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

This discussion has been archived. No new comments can be posted.

Learning Perl Objects, References & Modules

Comments Filter:
  • by fiftyfly (516990) <> on Tuesday August 05, 2003 @01:17PM (#6616634) Homepage
    Man I can't read my own perl, I can't imagine buying a book simply for the pleasure of reading someone else's
    • Re:Readability.... (Score:5, Insightful)

      by pestilence4hr (652767) on Tuesday August 05, 2003 @01:30PM (#6616793)
      Actually, I disagree and think just the opposite. In many cases, I find that perl is easier to read because of all the "symbols" at the begining of variables and such.

      For instance, in Java "String foo;" and in perl "$foo". Now, later in the code, if I see "$foo" in my perl code, I know immediatly that I'm dealing with a scalar, or %foo is a hash, whereas in most other languages I have to either remember the variable declarations or go back and find the variable declaration in the file.

      Also, I think alot the supposed unreadability of perl has to do with regex. Since regex is such a basic part of perl, it gets used alot and when you come across "$_ =~ s/^([^ ]*) *([^ ]*)/$2 $1/;" you may attribute the mess of characters to perl when in fact, most of the mess is regex, which exists in many languages.

      This is not to say that I haven't see lots of ugly code, perl or otherwise but I don't think perl is really any more difficult to read than other languages.
      • Oh no, I'm going to get moderated down, but honestly, I don't mean this as a troll.

        This got posted to a thread I was following once:

        * S_intuit_method
        * Does all the checking to disambiguate
        * foo bar
        * between foo(bar) and bar->foo. Returns 0 if not a method, otherwise
        * FUNCMETH (bar->foo(args)) or METHOD (bar->foo args).
        * First argument is the stuff after the first token, e.g. "bar".
        * Not a method if bar is a filehandle.
        * Not a method if foo is a subroutine prototyped to take a f

        • That code is handling "indirect object" syntax, a syntax that was an interesting experiment but is all but extinct, after discovering that it can lead to some interesting problems. Unfortunately, for backward compatibility, that code still has to DWIM a bit to keep the legacy code working.
      • >Now, later in the code, if I see "$foo" in my perl code,
        >I know immediatly that I'm dealing with a scalar

        And this could be any one of:
        - an integer
        - a real number
        - a string
        - a reference to an array
        - a reference to a blessed array
        - a reference to a hash
        - a reference to a blessed hash
        - a reference to a scalar
        - a reference to a blessed scalar

        Well thank goodness that $ is there so that it's so easy to tell what type of data the variable holds.

        I disagree that regex's are the reason some Perl code is har
      • Naming your variables is the clue here... I cannot event think of some code where I create a variable called foo.. name it afther its type, eg. sFoo for string, nFoo for int etc.. much more pleasing to read code. Same thing with classes and objects, classes = cFoo, objFoo for objects.. you get the clue.

    • Re:Readability.... (Score:5, Insightful)

      by eln (21727) on Tuesday August 05, 2003 @01:35PM (#6616841) Homepage
      The readability problem with Perl is a cultural one, not a language one. The language itself is very simple to read, with the possible exception of the more complex regular expressions.

      The difficulty lies in the fact that it is possible to obfuscate Perl to such a degree, and that so many Perl hackers seem to think more obfuscation makes them look like a better programmer. There's even a contect that rewards this kind of thing.

      If you want to write good, maintainable code, you can do it in Perl just as well as any other language. If you want to write an obfuscated mess, the same holds true. Sure, writing obfuscated Perl may make you feel more manly or whatever in the short term, but it won't help you keep your job when you can't read what you've written 6 months later.
      • Re:Readability.... (Score:2, Insightful)

        by pileated (53605)
        I think you're right about confusing obfuscation with programming machismo. But I have to say that no regular expression I've ever seen (except perhaps for last page of Mastering Regular Expressions) has been as baffling as something like $foo{$bar}{$foo2}. For me references and dereferencing and dereferencing shortcuts are the least readable elements of perl.

        But perl's mindset from what I can tell is power through brevity and flexibility. Going from it to Java is tortuous. So many words to type!!! But the
        • $foo{$bar}{$foo2}

          This shouldn't be confusing. How about foo[ bar ][ foo2 ]? Indexing into a 2-dimensional array in C. Your example is the same except that we index associative arrays.
        • Myself, I write Perl code to look as much like C as possible.

          Then if there's something Perl-like that's more efficient, or that can't be done with C-like syntax, I comment it up.

          So it IS possible to write readable Perl. You just have to think about doing it WHILE you're coding.

          • The C syntax is horrible, have you programmed
            in other languages in order to see the difference?
            I can think of at least 2 languages that are
            50 miles simpler to read.

            But syntax is not a major issue anyway. The
            main issue is the capabilities of the language.
            Apparently, those who speak on issues of syntax
            and general look-and-feel have no knowledge
            to talk about the more techincal issues. So here
            here you have it: 1000 posts about how the
            language "feels", and we are going to skip
            the hard technical issues which yo

            • >>The C syntax is horrible

              Oh, and what's better? Java? C#? C++? COBOL?

              You are incorrect in your assumption about tech knowledge as it relates to conversation about look and feel. Both subjects should be important to those who write code for a living.

              Tech issues? Which ones are important here? Please speak up and share your wisdom.

              • Yes, C syntax is horrible, at least when
                compared to Lisp, Basic, and Rexx .

                You imply that you make your living in programming and
                that the "feel" of a language is important. Why?
                As a programmer you should know that the "feel"
                of the language is probably the least of your
                worries. You know what other issues are important,
                but since you have to ask, and I don't feel
                like embarking on 3000 word essay, lets only
                mention that the capabilities of the language
                is more important than "feel", yes, and we are not
                fagots. W

      • I totally agree. There is *nothing* in the language that forces people to write bad code with Perl (and frankly there are plenty of unreadable non-Perl projects out there).

        On the POPFile project I've done everything I can to avoid Perl's temptations into obscurity by writing clear code. Amazingly I've been critized by monoric readers of the code that I could have done things with less "space" (i.e. using less screen real estate). People like that know nothing about maintenance of code and should just bu

        • Amazingly I've been critized by monoric readers of the code...
          Hey, you shouldn't discriminate against people with Mono. After all, it's a kissing bug, baby!
      • I think you're forgetting about all of the built-in $ variables.

        NOTE: I had actually written out a list of them here, and there are about 30 of them, but /. won't let me post it:
        "Lameness filter encountered. Post aborted!
        Reason: Please use fewer 'junk' characters."
        Which kinda makes my point in a roundabout way.

        I mean, seriously. These are all valid variables in Perl and have specific meanings. But they aren't exactly readable. Some of them (like $| and $_) you probably already know, but the Perl brevity /
      • The readability problem with Perl is a cultural one, not a language one. The language itself is very simple to read, with the possible exception of the more complex regular expressions.

        I totally agree with you. Even in the case of regexps, the /x modifier is available and you can use it to add spaces and even comments to enhance your code's readability. So again, it boils down to the programmer and his/her preferred style.

        The difficulty lies in the fact that it is possible to obfuscate Perl to such a d

    • by Frymaster (171343) on Tuesday August 05, 2003 @01:39PM (#6616883) Homepage Journal
      hey! there's some perl that's actually quite readable (and even poetic). witness the "black perl" script:

      BEFOREHAND: close door, each window & exit; wait until time.
      open spell book, study, read ( scan, select, tell us );
      write it, print the hex while each watches, reverse its length, write again;
      kill spiders, pop them, chop, split, kill them.
      unlink arms, shift, wait & listen ( listening, wait ),
      sort the flock ( then, warn the "goats" & kill the "sheep" );
      kill them, dump qualms, shift moralities, values aside, each one; die sheep ! die to reverse the system you accept ( reject, respect );
      next step, kill the next sacrifice, each sacrifice, wait, redo ritual until "all the spirits are pleased";
      do it ( "as they say" ).
      do it ( *everyone***must***participate***in***forbidden**s *e*x*). return last victim; package body;
      exit crypt ( time, times & "half a time" ) & close it, select ( quickly ) & warn your next victim;
      AFTERWARDS: tell nobody.
      wait, wait until time;
      wait until next year, next decade;
      sleep, sleep, die yourself,
      die at last
      and it actually parses.

      note: this script is for entertainment purposes only and is not meant as an endoresement of human sacrafise, real or virtual.

  • ... for those of us who can never remember the titles, only the critters.
  • 9.9? (Score:5, Funny)

    by mopslik (688435) on Tuesday August 05, 2003 @01:21PM (#6616686)

    Rating: 9.9 - Cannot find a fault

    Obviously, the review was calculated using an early Pentium [].

  • me too (Score:3, Interesting)

    by 514x0r (691137) on Tuesday August 05, 2003 @01:21PM (#6616694)
    It was with a problem that needed solving and a copy of the camel book that I started as a Perl programmer

    how else would one want to learn perl?
    • I seriously believe being a perl programmer is a little like being a smoker: After smoking a while you don't remember why you started anymore. All you know is that it's easier to continue than to break the habit. That's the case for me, anyway.
    • Me in 1999: I have to leave this stinking job! Hmm, dot-coms sound interesting...
  • well! (Score:1, Funny)

    by Anonymous Coward
    how about putting a spoiler warning! you practically gave away the ending!

    You did the author a huge disservice.
  • by stratjakt (596332) on Tuesday August 05, 2003 @01:22PM (#6616702) Journal
    I cant disagree with the reviewer more. This book is crammed with anecdotes and stories, and very little actual information.

    Which while some may enjoy cute little stories about the time the guy was up all night to meet a deadline, some of us read technical books to learn or enhance technical skills.

    This is so far from K&R it's sacrelige to even make the comparison. Shame on you.
    • I haven't read this book, but I'm fascinated by the moderation of the parent comment as "insightful"..."informative", perhaps... after all, it does confirm that the light nature of the writing style will turn off those who prefer dense technical writing... but it does so in a shallow manner that sheds no light on why such a writing style might be a bad thing. If anything, this post represents the opposite of insightful thinking.
    • And while we're at it, let's make perfectly clear that Learning Perl is simply an abridged version of Programming Perl.

      Mr. Schwartz does seem to know how to milk those cash camels, though!
    • Umm, what pages were those anecdotes and stories on????
      Still haven't found one at page 76.

      You did read the book didn't you?????
    • This is so far from K&R it's sacrelige to even make the comparison. Shame on you.

      Um, the reviewer was comparing K&R to "Programming Perl" -- a/k/a "The Camel Book" -- not to the book being reviewed. Which is a fair comparison in that both books pretty much define the language in question.
  • by squarooticus (5092) on Tuesday August 05, 2003 @01:22PM (#6616703) Homepage
    That book is essentially worthless except for looking up random facts after you've been programming C for a few months. In contrast, the camel book is useful even for long-time Perl hackers, because Perl has more built into the language (e.g., regexps, hashes, etc.) than C, the latter of which is incredibly simple by comparison.

    [Aside: The book I use most often is Stroustrup's C++ Second Edition, which in itself is rather vague and outdated wrt the details I need to know most often these days. I'm thinking of getting myself a copy of one of the C++ specs to help me answer the really obscure questions. Does someone recommend a particular spec (e.g., ANSI, ISO)?]
    • by murdocj (543661) on Tuesday August 05, 2003 @01:38PM (#6616875)
      That book is essentially worthless except for looking up random facts after you've been programming C for a few months.

      I couldn't disagree more. I learned C from the original K&R book. It was well organized, clear, and consise. The Camel book, on the other hand, often seemed like concepts on page n relied on concepts introduced on page n+1. I found that no matter how much I programmed in Perl (about a year's worth of time) and no matter how much I used the Camel book, I could never find what I was looking for without a massive search.

      • This is why I laughed at the original post -- if the Camel book is a "short, sharp introduction," I'd hate to see the reviewer's idea of a sprawling book.

        To be fair, a sprawling language like Perl needs a sprawling reference, and the Camel book does a decent job of it.

        Personally, I don't often refer to K&R, but that's because C is a simple language that you can learn in its entirety without too much effort. Who truly knows all of Perl? Or C++ or COBOL, to mention two other giant languages? A small per
    • by ggruschow (78300) on Tuesday August 05, 2003 @01:38PM (#6616876)
      I'm thinking of getting myself a copy of one of the C++ specs to help me answer the really obscure questions. Does someone recommend a particular spec (e.g., ANSI, ISO)?

      Actually, this [] pretty much solved all my obscure or arcane C++ questions. In fact, while referring to that I haven't once had trouble figuring out if I was implicitly causing a conversion which caused a deep copy which in turn caused a memory leak since.

      Of course, "Why did my program just pause for a 1/10th of a second, and how can I avoid that?" comes up more often now.

      • It took me a second to get the joke, but your point is well taken. I have taken great pains to implement garbage collection in C++, but significant understanding of the language is still required to avoid certain pessimal behaviors, which is especially problematic when others use my garbage collector. :)
    • [...I'm thinking of getting myself a copy of one of the C++ specs to help me answer the really obscure questions. Does someone recommend a particular spec (e.g., ANSI, ISO)?]
      There is only one C++ spec. You can get it from the ISO store [].
  • Perl: The Complete Reference is a very good and easy to read and understand perl book. Its somewhat old but still a great book.
  • Try perldocs (Score:5, Insightful)

    by Ars-Fartsica (166957) on Tuesday August 05, 2003 @01:24PM (#6616732)
    So much of this stuff is in the perldocs. I applaud O'Reilly for supporting open source but outside of the Camel book and the Perl Cookbook, I think the rest of the books are mostly redundant.

    At some point you have to put the books down and start programming if you truly want to master the language. After the Camel book is probably a good time to start, with references to the Cookbook when needed. For other info, the perldocs are recommended.

    • Re:Try perldocs (Score:4, Insightful)

      by eln (21727) on Tuesday August 05, 2003 @01:30PM (#6616798) Homepage
      The camel book is pretty much entirely in perldocs as well. In fact, most of it is verbatim.

      Having said that, the Camel book is probably the single most useful programming book I have ever read. I bought my copy 6 or so years ago (right after the 2nd edition came out) and I still use it to this day. It is unusual in that it not only allows one to pick up the language quickly and easily, but is concise enough to be used as a quick reference that is often more handy than the perldocs.

      It may be that I had already been programming Perl for too long before the other books came out, but I was never able to find anything really useful at all from them.
    • I can't say I fully agree with that. While the book may seem redundant for the experienced perl programmer, I just finished it and would definately say it fits it's target market. I know a bunch of developers who started with the llama, went to the camel, but lost out on the good info that this puts inbetween. Some kinda Oreo Cream filling between the llama and camel.

      I would definately recommend this book to the developers who are at that stage of their development. It's a useful tutorial style book for
    • Yeah, the perldocs are great. And yeah the Camel is a rehash of the perldocs. But it's nice to have a dead tree on the desk to stick bookmarks and postits in the pages, and to highlight.

      I know that I'm stating the obvious, but nothing in electronic media comes close to replacing printed manuals.
  • by bongoras (632709) * on Tuesday August 05, 2003 @01:26PM (#6616741) Homepage
    Has anyone read both this book and Damien Conway's book? I'd be interested in a comparison. I like the Conway book, but it's a little dense for me. Or I'm too dense for it... either way...
    • How bout "has anyone started both books?" Based on that comparison I'd say I've gotten farther in this book than I ever did in Damian Conway's book (which I had really high expectations for based on reviews). In fact I think I started the Conway book more than once but never got more than 1/4 of the way through it. I'm halfway through this one now and have no doubts that I'll complete it.

      Of course then I might go back and reread the Conway just to see if it makes more sense.

      So for me I prefer this one. Bu
    • I've read it cover to cover and use it frequently. Definitely the best perl book I've read (with the list of "perl books I've read" consisting of most of the O'Reilly line). Conway covers OOP theory, how to apply it in perl, neat perl-only tricks, and a lot of fun stuff. His examples are hilarious and his writing among the best traditions of technical instruction. Even OOP aside, I learned more about perl from Damian's book than anything else I've read. Highly recommended.
    • Conway's book is the best I've read on the subject of perl OOP. If you take the time to make sure you *understand* each and every concept and mechanism, the book will leave you with a firm understanding of objects. This shouldn't be a problem as the book is a delightful read. A firm understanding of the perl language, references, globs, packages, etc would be an important requisite as the book is not for the novice.
    • I started Damiens book, and it was way to dense for me. I just picked up Randals book and started it last night. It truly starts where learning perl (and the coookbook) ends and I feel that I'll be much more successdful understanding this book (and hence, becoming an OO perl programmer).

      I'm not bagging on Damiens book at all - it just started above my head.

      As for the poeple baggin on Randals book, my guess is is started at too low a level for them, so they think its useless - completly forgetting that t
    • Damian's book is great, but a good comparison would be that Learning Perl is to the Camel what Learning Perl Objects, References and Modules is to Damian's book. Both of my tutorial books are tutorial in design, based on years of classroom experience in teaching these subjects. Both of the other books are reference in design.

      Also, the OO part of the Alpaca book is only a portion of the text, and is necessarily light in coverage. The point of the Alpaca is to get you to understand most 100 to 10,000 lin

      • Damian's book is great, but a good comparison would be that Learning Perl is to the Camel what Learning Perl Objects, References and Modules is to Damian's book. Both of my tutorial books are tutorial in design, based on years of classroom experience in teaching these subjects. Both of the other books are reference in design.

        Hi, Randal,

        The Gecko book was very important to me when I made the big step from Perl as a replacement for awk scripts to Perl as an application development tool, around 1997 (the

        • The Jaguar book is dated. It filled a nice niche at the time, but the world progressed beyond it rather quickly. It describes a deprecated XS interface, an obsolete module packaging scheme, and objects before we really understood everything that was going on in Larry's head.

          It's still selling because it still sells. O'Reilly doesn't drop books that still make a profit, even when they're outdated.

          I'd consider the Alpaca plus Damian's book to be a complete replacement of everything that the Jaguar had

    • I second most of the positive comments here about Damian Conway's book.

      Just want to add that even after using perl for a few years, his beginning 1/3 chapters alone are worth the price of the book. It's a refresher on the fundamentals of perl, with good, funny examples of just about 90% of everything I knew. Even lots that I *didn't* know, with me going "Wow, I didn't know you can do that!". Heck, most of the important stuff from the Camel book is summarised here.

      The last 2/3 that deals with OOP is just g
  • If it is so ubiquitous, why embed a link to it?
  • Rating (Score:3, Interesting)

    by Karamchand (607798) on Tuesday August 05, 2003 @01:27PM (#6616754)
    Rating: 9.9 - Cannot find a fault. Uhm. Now please tell me - why not 10 then?
    • The next edition will be a 10. Or a 9.5

      Sounds like my employee review.

      "I'm only giving you an 85%. This way, I can give you an 88% next year, and since you're 'improving' you get a raise."

      If at first you give something 100%, any other than 100% is BAD.
    • Some people feel awkward rating anything 10 ever because (if taken incredibly literally) it means that there is no book which can ever be better than this book.
  • books (Score:4, Interesting)

    by erikdotla (609033) on Tuesday August 05, 2003 @01:29PM (#6616783)
    Some people need books, others don't. Personally I find the ActivePerl documentation to be excellent.

    The idea that you can do a PPM search for a module via CPAN based on your need, download it, and have it's docs integrated into the centralized documentation is great. perlfunc, perlre, perlobj, etc are a bit arcane but with a little elbow grease and a good editor (SlickEdit!), you figure things out pretty quick.
    • Cmon, this wasn't interesting. Maybe a 1. I demand that my points be revoked immediately.

      • I'd be happy to knock it down to a 2 or so.:-)

        BUTTTTTTTTTTTTTTTTTTTTTTTTTT, just before I read your post demanding that it be knocked down I was thinking that someone should start a new subject on "Learning programming through books - pros and cons" or some such thing. I keep noticing these statements from people who claim that they don't need to read books, and seem to be proud of it. Personally I think that's nuts. But there certainly do seem to be a number of people of that persuasion. Much of it seems
        • Re:books (Score:3, Interesting)

          by erikdotla (609033)
          Heh, I was kidding on the demote but who cares.

          I think the books vs no-books is based in part on age, but only because age relates to school, which is book oriented. Those who have been out of school a while, or never went to college, may find through experience that skipping books and going straight for built-in docs (or trial and error) works for them.

          Younger folks tend to prefer books especially if they just finished, or are still in, college, for obvious reasons.

          I see the Youthful Bravado angle, and
    • I think there's more to books than "need". I don't need technical books in most cases, because of the extensive information available online. This is especially true of perl, whose documentation is unbelievably vast. But I *like* books (as opposed to need). They're nice to have on the shelf and in a comfortable chair. It gets me the heck of the computer from time to time to read some thoughtful insight from somebody more experienced than me, and to read text that didn't have to be antialiased :)
  • by RevMike (632002) <> on Tuesday August 05, 2003 @01:30PM (#6616797) Journal
    One has to wonder if Perl would be nearly as popular if not for the excellent O'Reilly books to go with it.

  • My advice (Score:1, Funny)

    by Anonymous Coward
    Wait for the movie.

    I heard O'Reilly got Tom Cruise to be in it.
  • I have it too (Score:5, Informative)

    by JanneM (7445) on Tuesday August 05, 2003 @01:31PM (#6616807) Homepage
    I recently bought this, and for much the same reasons as the reviewer.

    Basically, if your introduction to Perl was via "Learning Perl" then this is probably a great next step. I went through the Camel book and the Perl cookbook instead, and find that this one does not give all that much more information as I would have liked. This is not strange; the authors explicitly say in the preface that this is the companion book to "Learning Perl".

    On the upside, it does give a good deal of useful snippets of info, and it manages to give clear explanations for some stuff that is otherwise quite opaque; the way it explains the Perl object model, for example is much clearer to me than the treatment given in the Camel book.

    I would have given it 7.5-8 rather than the extreme score the reviewer gave.
  • Half way through (Score:5, Insightful)

    by pileated (53605) on Tuesday August 05, 2003 @01:42PM (#6616904)
    and it's slow going, but I've sure learned a lot. Now maybe I'm dense but I don't think that references, anonymous hashes, references, subroutines are all that easily understood. In fact you can accomplish a whole hell of a lot in Perl without understanding them. But for anyone wanting to make the jump to larger more complex programs you really need to understand them. I'm just finishing the references section (first half) and still have the objects section ahead of me. I've read the tutorial on objects before and at first glance this book looks similar to it. But I didn't get as far in the tutorial as I would have liked, I think because I didn't understand references as well as I should. With the solid foundation that this book gives I think that I'll get a whole lot more out of the objects section, even if it more or less duplicates the tutorial (which I doubt).

    So, half way through, I give it two thumbs up. My Perl programming has just gotten a lot more sophisticated. Maybe I was dense to begin with but any step up is something I'm happy about.

    As far as those nutty complaints about O'Reilly lingering at the bottom of this thread all I can say is that they've found their proper place.
    • Perl 5's OO model is really, really painful.

      I wouldn't recommend it to anybody. The way it makes you put different objects in different files/modules is so counter to Perl's scripting heritage that a good procedural/reusability-based outlook will get a lot more traction than this OO mess, at least 'til Perl 6.
      • Re:Half way through (Score:3, Informative)

        by jslag (21657)
        The way it makes you put different objects in different files/modules is so counter to Perl's scripting heritage

        Different classes can be defined in the same file, no problem - just make a package declaration to begin each new one.

        Having said that, I've never wanted to actually have more than one class in a file. Sure, OO is counter to 'Perl's scripting heritage', but so what? There's a reason that much of the good stuff on CPAN is written in an OO style.
      • Perl 5's OO model is really, really painful.

        On the other hand, I adore it. I find it intuitive, it does just what I want it to do, and gets out of the way when I need it to. Like I tell my children, everybody is differrent.

  • How does honestpuck have teh time to review so many terse technical books? I wonder if these reviews are as well thought out as they could be if honestpuck was not trying to crank out 3 a week. I am going to propose the conspiracty theory that honestpuck is really an alias for a group of 10 Slash developers!
    • You dont have to read the book, or even know what it's about. Look for a post I made in this thread that got +5 Insightful. I've never read this book and I dont use Perl. Just string together a bunch of "kudos" or "boos" and toss in a couple buzzwords (K&R works fine), and there you go.

    • While it sometimes seems as if I'm paying the grocery bills for 10 people, no, there's only one of me.

      Actually, the last three reviews published here were written over about 6 to 8 weeks and submitted to Slashdot over a 5 week period. The books were read over an even longer period, it's just that I often write reviews in a surge of two or three at a time. I'm also usually writing a couple of reviews at once as I always re-read a book after a first draft of the review.

      Tony 'honestpuck' Williams

  • by Bluetrust25 (647829) on Tuesday August 05, 2003 @02:11PM (#6617226)
    Randal Schwartz is a regular over at He's replied to a couple of my threads and helped me out of some sticky situations. It's rare for such a talented programmer to be so accessible and helpful to the public.

    He's written well over 3,000 posts on Perl [] over at [].
  • by TheMostBob (538122)
    Dragon*Con [] this year, and probably local hacker cons PhreakNIC [] and Interz0ne [], if you want to meet him. He's a pretty happy drunk.


  • by blah1019 (695326)
    Can't imagine curling up with this one
  • ... because very few perl scripters know how to do it... write an OOP script in Perl, and only an expert will be able to maintain your work.

    This is so common in Perl (and other languages). Especially with contractors, for some reason. They come in, write expert level code, using all the secret codes and handshakes, then the average schmucks in the cube farms cannot maintain the code.
    • by Christianfreak (100697) on Tuesday August 05, 2003 @03:07PM (#6618139) Homepage Journal
      Wouldn't that be the fault of the people who didn't bother to learn basic concepts like OO programming rather than the fault of the people who know how to use it?

      OO in Perl is not hard, sure its syntax is a bit different but the concepts are the same and there are multiple books (like this one), online resources such as this [], and not to mention the existance of 4 (not 1 or 2 but 4) tutorials on OO in perl that come with the documentation. If people don't expect their "schmucks in the cube farm" to be skilled in a language then its no wonder that our jobs are going to India!
      • And there are reasons there are 4 documents about it. OOP shouldn't be as hard as Perl makes it out to be. Personally I try to pretend Perl doesn't have objects and even references, because trying to use the things is a complete nightmare. This is also the point you should switch to something better designed for the task - such as Python. ISn't @ISA the biggest hack possible??
    • Somebody once complained to me that I used obscure constructs in C like the ternary operator (a ? b : c). Obscure C?

      One could argue that the reason expert programmers are hired is so that they will "write expert level code".

  • Almost every perl programmer will spout on and on about how great the Camel book is when in fact, as technical books go, it sucks. Witty, eccentric examples don't make a great book. The fact is no one wants to admit that the book sucks because they will be thought of as a fool. So they proudly trumpet from the mountain tops that nothing is better than the camel book all the while hoping no one notices that they don't understand a bit of it.

    So, I will play the part of the small child in the story of "T
  • Great book and a must-have if you enjoyed "Learning Perl" and would like to round out your knowledge of the language. Daimon Conway's "Object-Oriented Perl" is also a great book and would follow nicely from Randal's if your objective is to write good OO code in Perl.

    Even though I already have Conway's book I still picked up Schwartz's since I need a quick refresher and Schwartz has a knack for being clear, concise and congenial for the real-world programmer.

    Definitely consider picking it up if your work
  • It certainly appealed to roughly the same audience, those who wanted a short, sharp introduction to a programming language.

    I like the Camel Book, but short it ain't. The Third Edition is 1067 pages. For that much paper you can have K&R2 and Advanced Programming in the UNIX Environment, or the ISO C spec and a pretty complete POSIX reference, or almost half of the GCC manpage.
  • I think you've missed the point if you try to do object oriented in Perl. If you want to do objects, use a language that was invented with objects in mind such as C# or Java.

While money can't buy happiness, it certainly lets you choose your own form of misery.