Slashdot Mirror


Learning Perl, 4th Ed.

Craig Maloney writes "Just about everyone out there who has ever typed #!/usr/bin/perl has encountered Learning Perl (otherwise known as "The Llama Book") in one form or another. You may have learned some of the intricacies of the language from this tome, or you've seen someone recommend this book to potential Perl programmers on-line. Learning Perl is generally in the top three recommended books for new Perl programmers, next to Programming Perl ("The Camel Book"). Now in its fourth edition, Learning Perl returns with updates covering the stable 5.8 series of Perl. The changes are subtle, but the improvements make for a clearer and more readable book." Read on for the rest of Maloney's review. Learning Perl, Fourth Edition author Randal L. Schwartz, Tom Phoenix and brian d foy pages 304 publisher O'Reilly rating 9 reviewer Craig Maloney ISBN 0596101058 summary The fourth edition of the classic text for learning the Perl language.

When I was initially introduced to Perl, I was one of those who was recommended to read Learning Perl. I picked up the initial edition (with the mauve binding), and began my journey into Perl. What I found was a dense, hard-to-follow introduction to the language, with the experienced Perl programmer in mind. I realized that the tutelage of this experienced programmer/author might be useful, but I opted for other books instead. As others looked to me for book recommendations, I recommended other works for people looking to immerse themselves in Perl, and relegated Learning Perl to the section of my library where live books with a steep learning curve (similar to the learning curve experienced by many with Kernighan and Ritchie's classic The C Programming Language). Like The C Programming Language, however, a full grasp of the language is not achievable from texts where the central focus is to avoid using the lingo and customs of those who are more familiar with the language. Only by full immersion in the culture of the language can one become fully proficient in that language. What's new? Learning Perl 4th edition has been updated in several ways from the previous edition. The text has been updated to reflect Perl 5.8, although this book doesn't introduce any 5.8 specific concepts. The new edition was reorganized from the previous version. The chapter on Regular Expressions is enhanced, and file handles are introduced in the I/O Basics chapter. CPAN is introduced in Learning Perl, since it has become much more important to beginners. The chapter on flat-file databases (DBM/DBM Hashes) didn't make the cut for this edition, but a good portion of the chapter made its way into Chapter 9 (Processing Text with Regular Expressions). The book has a cleaner feel to it, and flows without the erratic feel of the previous editions. What's good Learning Perl could rightly be called A Tourist's Guide to the Perl Culture. The material is immersive, and teaches Perl using the verbal language of a Perl programmer. No attempt is made to dumb down the material. This leads to sentences in the book like the following: Alas, these aren't words as you and I are likely to think of them; they're those \w-type words made up of ordinary letters, digits, and underscores. The \b anchor matches at the start or end of a group of \w characters. The previous sentence makes perfect sense for those who have already grasped the fundamentals of regular expressions, but for those who aren't quite up to speed, the previous sentence warrants further study. This can be a blessing or a curse for some. Ultimately, it forces the reader to understand the Perl culture which can only improve the reader's understanding of Perl. Also of note are the footnotes. Almost every page in the book contains footnotes commenting (sometimes sarcastically) about the topic at hand. Sometimes the footnotes can be distracting, as your eyes will busily look for the next humorous footnote, such as this little gem: And /,{5}chameleon/ matches "comma comma comma comma comma chameleon". By George, that is nice. What's Bad The only complaint I can level at Learning Perl is that there could be more explanation for some of the concepts in the book. In the section called "More Regular Expressions," the book presents the following example:

Here's the text:
I'm talking about the cartoon with Fred and Wilma!
And here's a substitution to remove those tags. But what's wrong with it?
s#(.*)#$1#g;
The problem is that the star is greedy. What if the text had said this instead?
I thought you said Fred and Velma, not Wilma
In that case, the pattern would match from the first to the last , leaving intact the ones in the middle of the line. Oops! Instead, we want a non-greedy quantifier. The non-greedy form of star is *?, so the substitution now looks like this:
s#(.*?)#$1#g;
And it does the right thing.
Unfortunately the less astute reader may not understand what exactly happened here. One line of output with the end result would help clarify what this regular expression did.

What's in it for me? Learning Perl would rightly be regarded as one of the classic texts for Perl programmers to read through at least once in their Perl careers. The book is chock-full of useful information, and even experienced Perl coders would do well to at least leaf through the pages of this book for paradigms to help their coding. Absolute beginner programmers would likely find this text a little over their heads, but intermediate programmers will find Learning Perl a valuable resource in their road to proficiency with Perl. You can purchase Learning Perl, 4th Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

172 comments

  1. Refreshing... by op12 · · Score: 4, Insightful

    Finally, a book review that's actually a review and not a summary or a novel in itself. Well done.

    1. Re:Refreshing... by Anonymous Coward · · Score: 0

      Doh! I just bought the 3rd Ed. last week.

      Freakin Amazon. I can't believe they haven't patented a method to warn people they're about to buy a book that's going to be out of date by the time it arrives.

    2. Re:Refreshing... by larley · · Score: 2, Insightful

      Amazon has quite a good return policy which lasts a few weeks, I think. You can probably send it back without much of a problem, giving the reason that a new edition just came out -- Unless it's already in bad, dog-earred condition... Which wouldn't surprise me, given the usefulness of the book. :D

    3. Re:Refreshing... by Anonymous Coward · · Score: 0

      Relax; even if you can't return it (as the sibling post mentions), the differences aren't major, and you've got possibly the best Perl book out there.

      Want my advice? Don't give yourself the hassle; just read the thing, be pleased that you've got a good book, write some great Perl and stop expecting life to be perfect. You're just going to make yourself depressed over something that isn't that big a deal.

    4. Re:Refreshing... by FLEB · · Score: 1

      And hit up your local library to spring for a copy (if you have a local library that may).

      --
      Information wants to be free.
      Entertainment wants to be paid.
      You just want to be cheap.
  2. Question by rk_cr · · Score: 4, Interesting

    I've got a question. I haven't read through it yet, but I've got a borrowed copy of 4th edition. Should I bother to read through it, or should I hold out for finding a 5th ed?

    1. Re:Question by Tackhead · · Score: 2, Funny
      > I've got a question. I haven't read through it yet, but I've got a borrowed copy of 4th edition. Should I bother to read through it, or should I hold out for finding a 5th ed?

      According to the Slashdot blurb up there, "The changes are subtle, but the improvements make for a clearer and more readable book."

      So I'd say - if you enjoy Perl, stick with the 4th edition. All those backticks, quotation marks, slashes, and punctuation marks are there for a reason. Subtlety? Yes. But for readability?!?! "Die!"

    2. Re:Question by Strontium-90 · · Score: 1

      According to the O'Reilly page for the book, the 4th Edition it has a publication date of July 05. The 3rd Edition was published in July 01. So, I'd say it'll be at least a couple of years before a 5th Edition comes out. If you can hold onto that borrowed copy for that long, then waiting would make more sense. But my guess is that whoever you borrowed it from will want it back before the 5th Edition is published.

    3. Re:Question by merlyn · · Score: 3, Informative

      We pitched this book to O'Reilly as "the last edition before Perl6 comes out". So, that's the scoop. One last chance to get Learning Perl for Perl5 correct. And apparently, we did the job.

    4. Re:Question by SeventyBang · · Score: 1



      Maybe I'm just brain numb from tonight's DARPA Grand Challenge meeting Go IRV! , but can you explain this?

      The text has been updated to reflect Perl 5.8, although this book doesn't introduce any 5.8 specific concepts

      This almost sounds like Twin Sons of Different Mothers


  3. Perl6 is a mistake by Anonymous Coward · · Score: 2, Informative
    I've been using perl pretty much constantly since the Pink Camel, and believe me, Perl 5 is an extremely good language for quick scripting things. That's what it was designed for. Sure, you can do big projects in it, but it's not exactly ideal. Recently I've started using Ruby as well, and I intend to move my department over to it instead of wasting time with Perl 6.

    One of the goals of Perl 6 is to make non-trivial projects possible. That's good. The way it's being done is bad. Perl was once a lightweight, extremely flexible language. Now it's become a huge ugly monster. People wanted OO, so a nasty hack was bolted on top to allow some semblance of it. Now this nasty hack is being expanded. Sure, the code's different, but the basic form is the same. Kludge upon kludge upon kludge; I'd much rather have a nice, clean, pure language (and not one with loads of irritating whitespace thank you very much).

    The same goes for the syntax. All the switching between $, @ and % is really irritating (ask a newbie how to get at the length of the keys array of a hash inside a hash, for example), and the changes proposed for 6 are just making this worse -- it seems that Larry, in his infinite wisdom, wants to prefix every data type with a different hard-to-type character. Perl was only designed for the three data types, and adding more is a mess.

    Perl 6 is a complete rewrite, but it keeps all the mess which has accumulated over the previous versions. This is not good. Sure, my const int $var = 27; may look neat (in the same way that, say, Pascal does), but $var isn't entirely constant, or entirely an integer, it's just a hack which makes it sort of behave like one. The whole thing is an exercise in pseudo-computer science masturbation with little real purpose except to please the managers who dislike the one thing that makes Perl special.

    On a similar note is regexes. I'm an avid fan of regular expressions simply because a nondeterministic finite automata is far more flexible than linear code. However, Larry must have been smoking that cheap $2 crack when he wrote this. Does he want Perl 6 to be flex or something?

    I won't be going on to use 6. It's a nice idea, but it's completely unnecessary. It won't make large projects any easier to manage (the language is still, at heart, an almighty hack -- an impressive one, but still a hack). It won't make OO any cleaner. It won't make development any faster. To put it bluntly, Perl scripts will still look less beautiful than our friend Mr Goat.cx. I'd prefer to use a language which has always been pure synthesis of science and engineering, not some half-baked imposter.

    Perl 6 will be nice, but I'm guessing it will be the end of Perl. It can't do what it wants to do whilst still being based upon a nasty mess. There are now other options, which provide all of Perl's power and none of the mess. Sorry, but *BSD^H^H^H^H Perl is dying. Larry is buggering it up the ass without lubricants, just like Shoeboy is doing to Larry's daughter.

    1. Re:Perl6 is a mistake by Anonymous Coward · · Score: 0, Interesting

      I'm surprised this was rated offtopic. It's certainly relevant to "learning perl"!

      I agree with you that perl is a huge shambling horror, but I don't agree with you that it's going to die.
      It's just going to be like x86, or POSIX, or the C++ standard-- knowing what we know now, many undergraduates could create better standards than these. At the time they were designed, though, they made sense.

      Just do like everyone else does. Use the parts of the standard that make sense, and pretend the rest doesn't exist.

      Personally, I use perl as kind of a "shell++".
      It's nice to have hashes, and easy-to-use regular expressions. Of course, I'm always irritated by the weak typing, lack of function prototypes, and general sloppiness and poor error handling of the language, but irritation is part of life.

      If you are working on a new design, of course you should use something better than perl. Any programmer worth his salt (and there are fewer of them than people realize) knows this.
      But some of us are stuck maintaining legacy perl code, and we know that the language will be around for a long, long time.

    2. Re:Perl6 is a mistake by 42forty-two42 · · Score: 1
      People wanted OO, so a nasty hack was bolted on top to allow some semblance of it. Now this nasty hack is being expanded. Sure, the code's different, but the basic form is the same.

      Admittedly, perl 5 OO is rather hackish, but Perl 6 OO truly is different. Instead of taking some random object and blessing it to a package, Perl 6 makes classes first-class objects, and allows instances to be created, just as in most other OO programming languages. Yes, even ruby.
    3. Re:Perl6 is a mistake by truckaxle · · Score: 1

      This post is repeated over-and-over on each and every perl topic. dont waste mod points or responding as the AC who posted it couldn't defend any of it.

    4. Re:Perl6 is a mistake by IpalindromeI · · Score: 1

      The reason that it was moderated down is because this troll shows up in every Perl story.

      --

      --
      Promoting critical thinking since 1994.
  4. Could substitute -freenode #perl for this by tulare · · Score: 1

    ...since half the people in that room have a bind setup to spam the address of Learning Perl in response to any question, no matter how obscure. One wonders why they bother.

    Fortunately, perl is headed into a blessed obsolescense... here's a hint as to why. Cheers!

    --
    political_news.c: warning: comparison is always true due to limited range of data type
    1. Re:Could substitute -freenode #perl for this by EnronHaliburton2004 · · Score: 2, Insightful

      ...since half the people in that room have a bind setup to spam the address of Learning Perl in response to any question,

      And that's one of the reasons why Perl is heading into oblivion. Rude users. Sometimes I'll be there, a newbie will ask a newbie question, and 5 zealots will jump down their throat.

      Worse then #debian sometimes, and that's hard to beat.

    2. Re:Could substitute -freenode #perl for this by jez9999 · · Score: 2, Insightful

      What's that you say? A pedantic language that requires you to use whitespace to specify blocks and doesn't massively improve on Perl is going to replace Perl, given that many Perl programmers wouldn't bother switching because of the former reason _alone_, not to mention the fact that they're already satisfied with the ease and elegance of Perl?

    3. Re:Could substitute -freenode #perl for this by mkcmkc · · Score: 1
      the ease and elegance of Perl

      Dang, you just made me spray my drink all over my desk!

      ;-)

      --
      "Not an actor, but he plays one on TV."
    4. Re:Could substitute -freenode #perl for this by j_d · · Score: 0

      lol poor photoshops killed perl lol

    5. Re:Could substitute -freenode #perl for this by Flounder · · Score: 1
      Ease?? Hell yeah.

      Elegance?? Are we talking about the same language? I can't wait to see Perl6.0, just to see Larry take another stab at OO Perl.

      --

      No boom today. Boom tomorrow. There's always a boom tomorrow. - Cmdr. Susan Ivanova

    6. Re:Could substitute -freenode #perl for this by bperkins · · Score: 1

      Wait. I don't get it.

      Is the Python headed to the Perl funeral home to pay his respects to his dead buddy fortran?

    7. Re:Could substitute -freenode #perl for this by Anonymous Coward · · Score: 1, Funny

      > Fortunately, perl is headed into a blessed obsolescense... here's a hint as to why. Cheers!

      Yawn. You python kids have been saying that for years. Ain't happened yet. In fact, Ruby's stolen a lot of your thunder now. Must be terrible to be so insecure that you can't stand on your own merits.

      How's Zope 3 doing, BTW?

    8. Re:Could substitute -freenode #perl for this by Jackmn · · Score: 1

      Hmm? I've never had any problems with the current implementation of OO in Perl.

    9. Re:Could substitute -freenode #perl for this by afd8856 · · Score: 1

      3.1 beta you mean...

      --
      I'll do the stupid thing first and then you shy people follow...
    10. Re:Could substitute -freenode #perl for this by hondo77 · · Score: 1

      Elegance?? Are we talking about the same language?

      You know the difference between a dance performed by a brilliant dancer and the same one performed by a no-talent hack? Elegant code is just like that dance.

      --
      I live ze unknown. I love ze unknown. I am ze unknown.
  5. International Order of the Llama by Shadow+Wrought · · Score: 0, Redundant
    Quick! Everyone make the Sign*!

    Hook you index and middle finger slightly while holding them together. Keep your thumb, ring finger, and pinky down. Place the side of your hands on the top your head between your temple and your ear. Rotate slowly. No I don't remember the reference but its funny as hell when a whole group of people doesn't it while shouting "Internation Order of the Llama!"

    --
    If brevity is the soul of wit, then how does one explain Twitter?
    1. Re:International Order of the Llama by Soko · · Score: 1

      Wow. You learn something new everyday.

      What's scary is that after a full night programming Perl/Tk, I usually end up doing this exact thing of my own volition, even though I've never heard about "the Sign" before the parent post.

      Excuse me while I go chase NumEntry() out of my brain with an ice pick...

      Soko

      --
      "Depression is merely anger without enthusiasm." - Anonymous
  6. People still use Perl? by spamfiltertest · · Score: 1

    /Sorry, couldn't resist... //Now in my 9th year of Perl

    1. Re:People still use Perl? by Anonymous Coward · · Score: 0

      "Now in my 9th.."

      I love perl. Now in my 3rd, after 15 years of Unix, C and all. For many years perl was just awks poor cousin that I didn't understand or use so much. I watched /lib/perl growing and cursing at how inefficiently Wall was 'reinventing awk and bash'. Then someone showed me a program they wrote in perl. Actually a whole dynamic webmin tool. I thought he must be mad to write in Perl, but now I am totally hooked and use it as a my first choice general purpose programming language for anything that doesn't need realtime embedded speed. The best OReilly perl book imho is the Cookbook (Ram book) which is where experienced programmers should dive right in.

      Also a lot to be said for perls peripheral support structure.

      CPAN is an archive/repository of perl modules that you can install as easily as typing:

      cpan -i mymodule

      perldoc and perlman speak for themselves. What is hidden is the clever way that perl embeds comments and 'plain old docs' in =pod within code and extracts this to render as html or whatever format you like. Perl is very 'self documenting'.

      The perl interpreter and debugger are so useful and powerful that alone they can be used to learn perl and make programs in a very 'hacky' way if you dont like reading docs :)

      It talks to the shell in a most elegant way. I'm not talking about backticks, I mean the proper System:: interface. Ditto for networks and sockets using Net:: , and for storage using the File::IO packages. Basically perl is a system programmers dream.

      Oh and you write inline C, and assembly, import object files, and even compile it properly now I believe.

  7. "What's Bad" section of the review by Anonymous Coward · · Score: 0

    Can someone explain the "What's Bad" section of the review? I don't quite get what either the author or the reviewer is trying to explain...

  8. Doing PHP by bahwi · · Score: 1

    I do mostly PHP now, because of whom I'm working for. But I've used Perl in the past and still do(when it's easier/faster to do it than PHP and no one will notice). Nothing really web wise for it, but it still fits nicely where other things don't.

    That's what I've always liked about Perl, it fills the void. Before PHP it was the CGI king, now PHP and ASP share that. But it's still there when you need it.

    I've been meaning to check out mod_perl2 which I've heard is finally stable. Anyone try it out yet? Comparisons to mod_perl1? That's the thing I miss in PHP, a lot of that functionality(mod_perl) is missing. But PHP works just fine. (Let's not start a flame thread under me, I'm sure there are plenty of other threads that are gonna erupt into flames).

    1. Re:Doing PHP by SeventyBang · · Score: 1



      You said "PHP and ASP" as though they are both languages. PHP is a language, ASP is a technology. ASP, which is server-side, can be written in VBScript, JScript, PerlScript, PHP, jeez, now I lost my place. As long as IIS has a way of translating the language|script in question to HTML (or anything else, for that matter - XML, embedded client-side script), it's viable.

      There seems to be a misconception that ASP==VBScript. And it couldn't be farther from the truth.

      It's not a sign of stupidity, it's a sign of unfamiliarity or lack of experience. If all you've ever used to write within the ASP world is VBScript, it'd be like saying, "When you say object-oriented programming, you have to be talking about C++". (which isn't, as it's a partial OO language. So we could throw things such as Actor and Eiffel into the mix and say either one of those is the only language in question when you say OOP)

  9. What's wrong with the example? by scribblej · · Score: 2, Interesting

    Here's the text:

    I'm talking about the cartoon with Fred and Wilma!

    And here's a substitution to remove those tags. But what's wrong with it?

    s#(.*)#$1#g;


    Uh... everything? What tags? Am I nuts, or doesn't s#(.*)#$1#g; always replace the entire string with itself? What could be more useless?

    1. Re:What's wrong with the example? by Rosco+P.+Coltrane · · Score: 2, Funny

      Uh... everything? What tags? Am I nuts, or doesn't s#(.*)#$1#g; always replace the entire string with itself? What could be more useless?

      Hmm, perhaps s#(.*)##g; ?

      --
      "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
    2. Re:What's wrong with the example? by sholden · · Score: 1

      I'm guessing some < and > characters didn't get escaped and hence some text disappeared when the HTML parser parsed it.

    3. Re:What's wrong with the example? by Reverend528 · · Score: 1
      I think you mean s$#(.$#@(!(lambda(x)`(,x))*^&%#)())##$#!@)#$#%

      TMTOWTDI, Indeed!

    4. Re:What's wrong with the example? by scribblej · · Score: 1

      No, at least that DOES something. It could be used by someone, somewhere, to accomplish something. But the example in the article... it does nothing!

    5. Re:What's wrong with the example? by Yath · · Score: 4, Informative

      Since it says something about removing tags, I'd guess that the reviewer's angle brackets got removed by Slashcode. It's probably something like:

      s#<(.*)>#$1#g;

      Which is indeed a good example of a bad regex.

      --
      I always mod up spelling trolls.
  10. Out of the way Jesus by Anonymous Coward · · Score: 3, Funny

    Larry is my savior.

    1. Re:Out of the way Jesus by dhuff · · Score: 1

      Larry might be a bit offended at that, seeing as how he's a Christian himself ;)

  11. Recommended books by Rosco+P.+Coltrane · · Score: 5, Funny

    Learning Perl is generally in the top three recommended books for new Perl programmers

    The other two being this one, and this one.

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
    1. Re:Recommended books by Otter · · Score: 1, Flamebait

      As with "The C Programming Language", "Learning Perl"'s prominence is based more on its historical significance than on its merits as a text compared to its competitors.

    2. Re:Recommended books by merlyn · · Score: 1

      That's certainly one AC's opinion. Good thing most people don't share your opinion. Otherwise, I wouldn't have a job.

    3. Re:Recommended books by Rick+and+Roll · · Score: 1

      Well, actually I think you would have a job. If you were the guy on PerlCast, you have two jobs, a writing job and a consulting (programming/managing) job. If you lose your writing job you still have your consulting job.

  12. Nice review by $RANDOMLUSER · · Score: 5, Funny

    > s#(.*?)#$1#g;
    But why the cartoon swearing??

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  13. Hated it by jafac · · Score: 3, Informative

    While, ultimately, I'm reserving Perl as a skill ONLY used when absolutely necessary (ie. when I get stuck debugging someone else's code) - I didn't like Learning Perl, or Programming Perl, or Perl in a Nutshell. All three of these books left me frustrated and completely lost.

    In sharp contrast, the Perl Cookbook, gave me answers to all of my questions. I recommend Perl Cookbook to anyone. The other books? Only to masochists.

    --

    These are my friends, See how they glisten. See this one shine, how he smiles in the light.
    1. Re:Hated it by holy+zarquon's+singi · · Score: 2, Informative

      I tend to concur, although Learning Perl Objects, References and Modules is a pretty good read and a good companion to the cookbook.

      --
      "...we should just trust our president in every decision that he makes and we should just support that." B.Spears 2003
    2. Re:Hated it by PCM2 · · Score: 2, Informative

      I sort of concur, though you have to start somewhere just to pick up the syntax of the language. For that, I used Programming Perl (the bigger, more reference-oriented book). Probably the most enlightening one I read was Advanced Perl Programming, which has also just been updated. That was the one that made me say, "Ah-haaaaaa, so there's more to this than CGI scripts."

      --
      Breakfast served all day!
    3. Re:Hated it by slavemowgli · · Score: 1

      I personally absolutely loved Programming Perl (3rd edition), and in fact, it's the book I used to learn Perl, too.

      I also still use it as a reference - finding stuff in there usually takes less time than Googling for it or looking at the manpages. :)

      To each their own, of course, but I think it's not fair to characterise Programming Perl at least as a bad book.

      --
      quidquid latine dictum sit altum videtur.
    4. Re:Hated it by glwtta · · Score: 1
      I'm reserving Perl as a skill ONLY used when absolutely necessary

      Yeah, so do I. It's also the only language I use day to day :)

      I find that Effective Perl Programming is a nice "once you know the syntax" book. I don't actually remember what books I learned Perl from (I think I skimmed the Camel and then just read the perldocs), but reading this one in "retrospect" I found a lot to agree with.

      --
      sic transit gloria mundi
    5. Re:Hated it by Rick+and+Roll · · Score: 1

      Sounds like somebody hasn't discovered he power of CPAN!

    6. Re:Hated it by jafac · · Score: 1

      actually, "the power of CPAN" is verboten where I work. I can look shit up in books, but I can't download code. Dumb rules.

      Anyway, I feel kind of guilty for getting modded to 5 for ripping those books, but I thank all the responders for their tips on good perl books.

      --

      These are my friends, See how they glisten. See this one shine, how he smiles in the light.
    7. Re:Hated it by Rick+and+Roll · · Score: 1

      Well apparently people just agree with you. And even though I like Larry Wall (he has a cool story about creating Perl and his talk about Perl 6 is interesting to me), I am inclined to agree with you about Programming Perl at least. There is a lot of fluff in that book.

    8. Re:Hated it by Anonymous Coward · · Score: 0

      In sharp contrast, the Perl Cookbook, gave me answers to all of my questions.

      Give a man a fish...

  14. Pattern by Anonymous Coward · · Score: 1

    I really don't get the whole pattern matching in perl. Give me something that is straight forward like in objectscript Variable?3N1"-"3N1"-"4N to verify a telephone number. How easy is that?

    1. Re:Pattern by Anonymous Coward · · Score: 0

      Not powerful though. How would you match the character N? How would you match all characters other than N?

    2. Re:Pattern by AuMatar · · Score: 3, Informative

      You can do it similarly in perl-

      \d{3}-\d{4}

      The reason perl implementations tend to look worse is that they try and catch other ways of writing phone numbers- removing the -, adding an area code, optional whitespace, etc.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    3. Re:Pattern by eyeye · · Score: 1

      I really don't get the whole pattern matching in perl. Give me something that is straight forward like in objectscript Variable?3N1"-"3N1"-"4N to verify a telephone number.


      You are kidding, or insane, or think that "straight forward" means hard to understand.
      --
      Bush and Blair ate my sig!
    4. Re:Pattern by r2q2 · · Score: 1

      Use an escape character to match N.

      --
      My UID is prime is yours?
    5. Re:Pattern by jcuervo · · Score: 1
      The reason perl implementations tend to look worse is that they try and catch other ways of writing phone numbers- removing the -, adding an area code, optional whitespace, etc.
      s/[^\d]//g; # Remove anything not a number
      /^(\d{7,10})$/ || warn "Bad phone number";
      $phone_number = $1;
      Looks okay t'me.
      --
      Assume I was drunk when I posted this.
    6. Re:Pattern by Anonymous Coward · · Score: 0

      I did this myself once, and someone who looked at my code was shocked, SHOCKED! that I had stripped out all the nondigits before checking.

      I pointed out that I was going to reformat it to (123)456-7890 anyway, so it didn't matter.

      I did end up skipping the check and formatting for international numbers (defined as any phone numbers starting with +)

  15. regex by __aahsof7392 · · Score: 3, Informative

    Example makes no sense.

    $ echo "I'm talking about the cartoon with Fred and Wilma!" | perl -pe 's#(.*)#$1#g;'
    I'm talking about the cartoon with Fred and Wilma!
    $ echo "I thought you said Fred and Velma, not Wilma" | perl -pe 's#(.*?)#$1#g;';
    I thought you said Fred and Velma, not Wilma

    1. Re:regex by slavemowgli · · Score: 2, Informative

      The author just forgot to escape some < and > characters in there, so part of the regexes gets interpreted as HTML.

      And of course, the Slashdot editors didn't catch that, but that's probably hardly surprising...

      --
      quidquid latine dictum sit altum videtur.
  16. Python's better by slashzero · · Score: 1, Flamebait

    there I said it.

    1. Re:Python's better by PerlDudeXL · · Score: 1, Funny

      I don't care.

    2. Re:Python's better by slashzero · · Score: 1

      heh, is it 1990 again?

  17. the review by Amouth · · Score: 3, Insightful

    from the looks of it, seems like a nice book but what we need is, a book that beats people into submission so that they make READABLE perl .. 99% of the perl i look at makes me want to kill someone.. (i make sure someone else is in the room)

    --
    '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    1. Re:the review by chromatic · · Score: 3, Insightful

      Perhaps you'll like Perl Best Practices then.

    2. Re:the review by Anonymous Coward · · Score: 0

      99% of the perl i look at makes me want to kill someone..

      It was one good look at perl which made me decide to become a proctologist.

    3. Re:the review by Tsiangkun · · Score: 5, Insightful

      Not trolling here,

      When kids learn to read, they sound out each letter.
      Then readers progress to sounding out each syllable.
      Advanced readers can read in words instead of syllables, and no longer sound out each piece.
      Really advanced kids read in phrases and sentences.

      Perl is like learning to read two languages at once. One needs to develop proficiency in regular expressions, and the Perl language itself to be able to read Perl script effectively.

      Most of what people bitch about is the regular expressions, and not the Perl itself. Yes, the syntax might be tweaked on the Perl implementation of regular expressions, but if you understand them well in another form, it's not mind boggling. The tight integration of regular expression and a programming language leads to elegant problem solving methods, and I appreciate them the same way I appreciate a koan.

      Once someone can read and write, they seldom use the same expressions as someone new to a language. This only further alienates newbies and adds to the theory that Perl is unreadable line noise. Perl is Perl, and one either gets it or they don't. No amount of formatting will make it any clearer if the reader only knows baby speak for either regular expressions or the Perl language.

    4. Re:the review by merlyn · · Score: 1
      book that beats people into submission so that they make READABLE perl
      One of the key issues repeatedly addressed in this book (and our courses) is readable and maintainable Perl.

      We often talk about "the maintenance programmer". As in, "you, three months/weeks/hours from now, when you can't remember what the hell you wrote", and how to write for "that" person.

      Believe me, I have a vested interest in removing the "Perl is unreadable/unmaintable" meme. It shall die!

    5. Re:the review by jcuervo · · Score: 1
      JAPHs can't possibly be helping. ;-)

      I kind of like it, anyway. Half the stuff I write in Perl makes my friends' heads explode. E.g.:
      (01:41:03) Cuervo[0]: you really, really have to see what I just got done with.
      (01:41:11) Morph: oh please god no
      --
      Assume I was drunk when I posted this.
    6. Re:the review by tepeka · · Score: 1

      Now I know there's the whole emphasis towards refactoring, but unless you're doing machine-level stuff for an atm machine or a missile silo, I just don't get it. Sure, the Perl I write would have purists tearing their hair out. But the point is I can come back a year later and understand what I meant because a) I write it in a painstaking and boring fashion; and b) I comment it. Cycles are cheap - what't the problem with using them?

    7. Re:the review by merlyn · · Score: 1
      JAPHs can't possibly be helping. ;-)
      In all honesty (I've said that twice in this thread), if I had to do it all over again, I would not have invented the JAPH.

      No one thing seems to have more affected how people think about Perl. {sigh}

    8. Re:the review by glwtta · · Score: 1
      JAPHs can't possibly be helping.

      Yeah, but it's not all that much fun posting this at the monastery:

      #!/usr/bin/perl
      use strict;
      use warnings;

      print "Just Another Perl Hacker\n";
      --
      sic transit gloria mundi
    9. Re:the review by freeze128 · · Score: 1

      That's strange... 99% of the perl I look at makes me wish I were dead. We should get together...

    10. Re:the review by mbrewthx · · Score: 1

      New to Perl and finishing up the Third edition of your book. I don't find it all that hard to maintain or read. Just write good code.

      But when I wrote in COBOL we purposely made it hard to understand for job security.

      PS Shakti says hi

      --
      __________ Leave me alone I'm compiling a RPG II program on my S/36...Thanks to metamucil I'm a Regular Meta Moderator
    11. Re:the review by Anonymous Coward · · Score: 0

      I think the biggest problem with using a "painstaking and boring fashion" is that you may be using the paradigm of another language (typically C, in my limited observations) rather than just a verbose Perl style. People end up using arrays instead of hashes when hashes work better. Then you end up with convoluted lookup subroutines to mine multi-dimensional datastructures when simple access methods already exist for Perl's built in data types.

      I don't see anything wrong with using verbosity in writing in any language, but eschewing the tools the language gives you is a huge mistake, IMO.

  18. Cynical O'Reilly marketing exercise by onlyjoking · · Score: 3, Insightful

    The text has been updated to reflect Perl 5.8, although this book doesn't introduce any 5.8 specific concepts.

    So how exactly does this edition "reflect" Perl 5.8 then? Is is it enough just to drop a reference to 5.8 and leave it at that? This book is nothing more than a cynical O'Reilly marketing exercise. The sample chapter from O'Reilly is identical to the corresponding chapter in the 3rd edition while a brief look at the table of contents shows nothing more than a re-arrangement of the previous edition. Anyone who has the 3rd edition will be wasting their money buying this book.

    1. Re:Cynical O'Reilly marketing exercise by merlyn · · Score: 3, Informative
      Actually, can I be honest?

      We didn't really have 5.8's differences in mind. However, we made sure that the exercises were not invalidated by 5.8.

      So yeah, you got us. It's a marketing ploy.

      However, we did do more than "rearrange" things. We're constantly updating our Llama class, and the latest changes were indeed dragged back into this book. So, you've got the best of an already good class, as updated by people that are teaching it every week.

    2. Re:Cynical O'Reilly marketing exercise by onlyjoking · · Score: 1

      Maybe O'Reilly should have offered as a sample chapter one that clearly differed from the 3rd edition then? What I found particularly cynical in the downloadable chapter was virtually zero new content and the occasional arbitrary change of the first word in a paragraph to give the impression that it contained new material.

  19. PP 4th ed.? by slavemowgli · · Score: 1

    Sounds interesting. Does anyone know whether there's gonna be a 4th edition of Programming Perl (the Camel Book) anytime soon, too?

    --
    quidquid latine dictum sit altum videtur.
    1. Re:PP 4th ed.? by chromatic · · Score: 1

      There probably won't be a new Camel for Perl 5.

    2. Re:PP 4th ed.? by slavemowgli · · Score: 1

      Darn. :P

      --
      quidquid latine dictum sit altum videtur.
    3. Re:PP 4th ed.? by merlyn · · Score: 2, Informative

      Camel 4ed will likely come out after Perl6. So Camel 3ed is likely the last Perl5 edition.

    4. Re:PP 4th ed.? by slavemowgli · · Score: 1

      Thanks for the info. :) Are there any current estimates regarding the release date of the first Perl6 version?

      --
      quidquid latine dictum sit altum videtur.
    5. Re:PP 4th ed.? by Anonymous Coward · · Score: 0

      estimates? you'll be lucky if you ever see a Perl6

  20. The regex example as it should have displayed: by Craig+Maloney · · Score: 4, Informative

    Here's the text:
    I'm talking about the cartoon with Fred and <BOLD>Wilma</BOLD>!

    And here's a substitution to remove those tags. But what's wrong with it?

    s#<BOLD>(.*)</BOLD>#$1#g;

    The problem is that the star is greedy. What if the text had said this instead?

    I thought you said Fred and <BOLD>Velma</BOLD>, not <BOLD>Wilma</BOLD>

    In that case, the pattern would match from the first <BOLD> to the last </BOLD>, leaving intact the ones in the middle of the line. Oops! Instead, we want a non-greedy quantifier. The non-greedy form of star is *?, so the substitution now looks like this:

    s#<BOLD>(.*?)</BOLD>#$1#g;

    And it does the right thing.

    1. Re:The regex example as it should have displayed: by msblack · · Score: 2, Funny

      and now the review makes sense.

      --
      signature pending slashdot approval
    2. Re:The regex example as it should have displayed: by andrew71 · · Score: 1


      Gosh. Thanks. I was just beginning to think of myself as the less astute reader.

      --
      13-4=54/6
    3. Re:The regex example as it should have displayed: by Suppafly · · Score: 1

      thank you, i was going crazy trying to figure out what the example was talking about.

    4. Re:The regex example as it should have displayed: by humankind · · Score: 1

      (snoopy dance)

      I learned something useful on Slashdot today!

      (snoopy dance)

      Sorry, couldn't resist... thanks for the great post.

    5. Re:The regex example as it should have displayed: by johnny99 · · Score: 1

      Can't someone FIX that?

  21. Little Point Learning Perl If Not Already Learned by aldheorte · · Score: 2, Interesting

    Some may consider this a troll, but, knee-jerk reactions aside, from a professional standpoint, unless you have to maintain some legacy system that uses Perl, or an interest in historical programming languages, there is very little point in learning Perl. You can find all of its benefits in more modern non-compiled languages without the cruft of years of esoteric development. I will not mention other languages as that will just start a religious war over everyone's pet language, but, seriously, aspiring technologists take note and do your research.

    If you already know Perl, that's great and good that you learned it when you learned it, but it doesn't change the above.

  22. I waiting for perl.NET to be released! by bubbaD · · Score: 2, Funny

    I joke, I joke. I have Visual Python!

    1. Re:I waiting for perl.NET to be released! by truckaxle · · Score: 2, Informative

      Why is this funny? I have sitting on my desk "Programming Perl in the .Net Environment" by Yevgeny Menaker, Michael Saltzman and Robert j. Oberg published by Printice Hall. The book is about 2 years old now.

  23. Re:Little Point Learning Perl If Not Already Learn by chromatic · · Score: 1
    I will not mention other languages...

    ... or back up your vague assertions with anything more solid than "because I said so".

  24. Here You Go by mkcmkc · · Score: 1
    or back up your vague assertions with anything more solid than "because I said so"

    I'm not the original poster, but here you go:

    More than enough to send me running screaming...

    Mike

    --
    "Not an actor, but he plays one on TV."
    1. Re:Here You Go by truckaxle · · Score: 1

      So I point to the gcc man page and become overwhelmed for the available options for gcc is that enough reason to go "running or screaming" into the dark night.

      Or if provide a link to the winners of the last C obfuscation contest winners should I just issue the following as root and be done with it

      root> find / -name \*.c -exec rm -f {} \;

      Part of the complexity of Perl is its richness which often allows you to succiently solve a problem with elegance and clarity. And almost all the complaints about "line noise" or "explosions in a ascii factory" are from the presence of regular expressions or formats which both are indispensible for text manipulations.

    2. Re:Here You Go by shaitand · · Score: 1

      Actually most of them come from perl references, for instance how to do you iterate through a hash of arrays of hashes of arrays of arrays?

    3. Re:Here You Go by TheLink · · Score: 1

      Most people don't really completely know English, and it is full of weird exceptions and anachronisms. However that doesn't stop lots of people from using it, and English remains arguably one of the most useful languages in the world.

      Look at tons of slashdotters here who have atrocious English - even if it's apparently their "mother tongue".

      Despite all their elegance etc, LISP and its close relatives have not caught on.

      --
    4. Re:Here You Go by mkcmkc · · Score: 1
      But it's pretty obvious that the overwhelming reason why English is so useful is because it's the most prevalently used language, correct? This is very important for human communication, but it's a much less important criterion for choosing a programming language. (If it *is* a very important criterion, than you probably should be using C, C++, or C#--not Perl.)

      People often talk about questions like this being "religious", meaning that there is no meaningful difference between the options. For programming languages, though, it seems like there are significant intrinsic differences. If it were possible to investigate this scientifically, with cohorts of novice programmers, I think that we would see a real difference across languages. And I believe that Python would be measurably better than Perl. (I can imagine that other languages would be better than both, and I'd be curious to know what they'd be.)

      Mike

      --
      "Not an actor, but he plays one on TV."
    5. Re:Here You Go by TheLink · · Score: 1

      The reason why perl is so useful is because of CPAN ;).

      --
  25. Python, not anymore. Ruby, maybe but doubt it by systems · · Score: 2, Insightful
    Why? Mainly the OO paradigm, big turn off

    Okay, I am one of those, generalists, prgrammer wannabe.
    I have spent time with, C, C++, Objective-C, OCaml, Python, Java, Bash scripting, Perl, Tcl, Sql and maybe others.
    And even thought Python was kind sometime, my main pick, I had to give up on it.
    Python is hard, harder to learn than even C.
    Learning how to program in OO, is hard, and python, regardless of what you say doesn't make it easier.
    To really understand the different programming paradigm, you have to learn more than one language, an programmer who haven't look on at least 5 languages shoul question his own skills.
    Anyway, Perl biggest assets in my opinion, are
    • The wealth of it's literature, you can find a Perl book covering almost any programming corner and topic.
    • That Perl book, will be effectively teaching you a CPAN library
    Python, will never have that, mainly because no other language have that, Perl is unique in this. Plus OO programming, is just tuff to swallow, in theory, I would say OO offer a very nice level of uniformity and abstraction to any program, but in real life, it's just easier to deal with the mess of procedurla programming. And don't think of data, and behavior owners.

    Good luck with your Pythonic dreams, but ... honestly, I wouldn't recommend Python, well not anymore.

    1. Re:Python, not anymore. Ruby, maybe but doubt it by snorklewacker · · Score: 1

      > Plus OO programming, is just tuff to swallow

      I smell a spelling troll. Makes the rest a bit suspect.

      If you are serious, then well, sorry you couldn't hack it. Java I'd accept as an example of enforced OO run amok, but if you can't even handle python, then I suggest getting a nice non-technical job that won't stress you out too much. I don't even like python all that much, but I would hardly call it any more challenging than, say, Visual Basic.

      --
      I am no longer wasting my time with slashdot
    2. Re:Python, not anymore. Ruby, maybe but doubt it by renoX · · Score: 3, Insightful

      Well of course if you're used to Perl, OO programming will seem very hard to learn :-)

      For learning OO programming, I'd advise 'Object-Oriented Software Construction' it use Eiffel as its programming language, and is quite old but it is very, very clear about why OO programming makes sense.

      And for me, Python or Ruby (preferably) are better than Perl because those language have a readable syntax by default, in Perl you have to fight the language to produce readable code, thus a big majority of Perl code is just unreadable, barf.

    3. Re:Python, not anymore. Ruby, maybe but doubt it by systems · · Score: 1

      I was hurt when you said I should seek a non-technical job.
      But since you was nice enough to notice my post and reply. I have to return the favor.
      I am not saying I am good, but I honestly want to be good (in term of programming skills). I whole heartdely believe that the best way is to have a broad view of the issue, when it comes to programming this translate to learning different languages that implement the multitude of programming paradigms ever invented.
      I do believe, that solve a problem, in terms of OOP is not simple, I wasn't saying it's beyond me, I am just saying it's hard. And honestly most book, dump down this fact.
      To solve a problem you need a plan, to execute a plan (in OOP) you need actors, actions in the plan, will be the responsibility of specifice actor.
      I was being quick in representing my view of OOP, but the bottom line, tryin to solve many problems this way, complicated the solution, you don't always need actors and responsibility assignement.
      Of course there is more to OO, but the problem is the same. OO can easily be an overkill.
      Maybe I am being irrational, and not fair, maybe problem solving does depend on the problem solver taste and way of thinking, I feel more comfortable with dealing with C, Perl and Tcl (I love Tcl). And think of problems in terms, of Input, Process, Output. Instead of actor and responsibilities.

    4. Re:Python, not anymore. Ruby, maybe but doubt it by Anonymous Coward · · Score: 0

      Python is hard, harder to learn than even C.

      What are you smoking? After that statement I think a lot of people will be questioning your skills, or at least they should be.

      As for the OO stuff, Python really does not force it upon you like some other langauges such as Java.

    5. Re:Python, not anymore. Ruby, maybe but doubt it by snorklewacker · · Score: 1

      You were taught OO very poorly. In fact, I do tend to structure OO as input and output, where simple input is composed into higher level objects that are then stored and organized according to attributes on those units. Commands come in to select or transform a set of objects, and their output is another set of objects that are decomposed to raw output. No "actors" involved, really, and responsibilities are often a bit muddled (I have many methods that effectively script method calls on other objects, which causes lots of coupling). No one said it was a religion.

      Admittedly, a lot of what I do could be done with a RDBMS instead of an OO system, but that actually requires more structure than I enjoy (mostly it's schema evolution that bothers me).

      Engineering an OO app is hard -- any engineering is hard. OO hacking is easy. You want hard, try haskell.

      --
      I am no longer wasting my time with slashdot
  26. Abusive IRC channels by Anonymous Coward · · Score: 0
    Aye, the practice of some on IRC to mock those that don't quite understand some topic or another is annoying. We create #SuseLinux on irc.freenode.net because of that very same type of attitude in #suse. The sad part is that #suse used to be a great place to find help, and several of the old SuSE GMBH developers used to hang out there.

    Sigh.

  27. I keep a copy of Perl 5 for Dummies on my desk... by suitepotato · · Score: 2, Funny

    ...just to remind me that there are things in this world less sane than C++ but oddly more seductive.

    The other Perl books I keep in my private collection with my BSD books hidden behind a box of pr0n tapes and DVDs so no one thinks I'm a total perv.

    --
    If my grammar and spelling are off, I am [distracted/tired/careless] (take your pick)
  28. Ruby by superwombat · · Score: 0, Redundant

    Learn Ruby instead. Your fellow programmers will thank you.

    1. Re:Ruby by Matimus · · Score: 1

      ... for making them learn a new language? You are dreaming! (even if I do agree that Ruby is 100x easier to read)

      --
      GENERATION 25: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social exper
    2. Re:Ruby by Anonymous Coward · · Score: 0

      ..and slower...and less mature

  29. Top three recommended books for Perl newbies by Anonymous Coward · · Score: 1, Interesting

    Learning Perl is generally in the top three recommended books for new Perl programmers, next to Programming Perl ("The Camel Book")

    Programming Perl (Camel Book)
    Learning Perl (Llama Book)

    Okay, I'll bite. What's the third book?

    1. Re:Top three recommended books for Perl newbies by merlyn · · Score: 1

      Well, you can either go with The Alpaca book (Learning Perl Objects References and Modules), or The Perl Cookbook. I've heard both touted as "the third book".

    2. Re:Top three recommended books for Perl newbies by Anonymous Coward · · Score: 0

      I liked Advanced Perl Programming. *shrug*

    3. Re:Top three recommended books for Perl newbies by wagemonkey · · Score: 1

      It may not be specifically perl (even if it is on O'Reilly's Perl page) but I find Mastering Regular Expressions invaluable too.
      Mind you maybe I like Perl (though I don't get to use it as much I'd like) because I have the sort of mind to enjoy the Friedl...

    4. Re:Top three recommended books for Perl newbies by hondo77 · · Score: 1
      My on-the-job Perl bookshelf (after you've read Learning Perl):
      1. Programming Perl
      2. Perl in a Nutshell
      3. Perl Cookbook
      4. Object Oriented Perl (though I pretty much have this down and don't really refer to it anymore)
      Now that Damien's Best Perl Practices is about to come out, it may be replacing #4.
      --
      I live ze unknown. I love ze unknown. I am ze unknown.
  30. Re:Little Point Learning Perl If Not Already Learn by merlyn · · Score: 1
    From what I've been hearing from hiring managers, the jobs for Perl are largely going unfilled, because since the dot-bomb, many good Perl hackers jumped ship early and are now underemployed in crappy other-language jobs.

    So, learning Perl today may actually increase your job potential. New startups are happening all the time, including projects that are shifting away from Java and dot-net, and toward real workable open-source solutions.

  31. why learn perl NOW? by Anonymous Coward · · Score: 0

    Seriously, I was a perl fanboi a long time ago. Of course I'd love to use Lisp or something but Perl's so darn *practical*. Or pragmatic, if you will. And you can still do a lot of cool stuff like pass anonymous code blocks around or "roll your own" object system.

    But come on, Perl stopped being cool maybe 5 years ago. I remember when I started using Perl 5. I thought the objects were cool. I started dreaming of a powerful object oriented interpreted language with the power of Perl but a sane syntax.

    I tried Python 1.5, couldn't quite "get" the vibe of it, it felt bolted together from random parts, some design choices just didn't make sense. (Tried it again recently, still doesn't make a lot of sense.)

    Then I discovered Ruby 1.6 (via the Dr. Dobbs article like many others). WOW! The power of Perl but AWESOME lightweight syntax and consistency. Truly a beautiful language. I can't imagine EVER going back to Perl. In Ruby you don't have to choose between "==" and "eq" for instance.

    And some of my friends who didn't like Perl went to PHP because it was simpler. Less powerful sure, but easier to get things done.

    Now Perl 6 is coming up and it looks AWFUL. Like somebody didn't just put in everything but the kitchen sink, but EVERY BLOODY TYPE OF KITCHEN SINK THEY SELL! Just too much for my little brain. It's Ruby for me. As soon as Ruby gets a real VM and unicode support, it will be the only language I need.

    So again I ask the question.. why perl?

    1. Re:why learn perl NOW? by Chokma · · Score: 1
      And some of my friends who didn't like Perl went to PHP because it was simpler.
      Now Perl 6 is coming up and it ... [is] Just too much for my little brain.
      So again I ask the question.. why perl?

      Yes, it's true: Perl is not for everyone - think about it:

      • Early Perl books came with a warning "Do no expose lesser humanoids to the language of the masters because their tiny heads may explode." Strange, but true.
      • Perl is a language for adults only. Seriously. There is a law in Texas about this, because it is more addictive than sex and could really hurt World of Warcraft sales if everyone started coding in Perl.
        On the plus side, Perl does not attract as many kiddies who hype their obscure language on slashdot in a way most consistent with penis enlargement mails.
      • Perl is taught by enlightened monks to worthy pupils, not peddled like some sort of programmer's snake oil in the dark backyards of the Usenet.
      • Perl is not for people who value AWESOME lightweight syntax and consistency - but then, those are the people who support Intelligent Design and admit to doing it with Pythons.

      So, yes, you are absoulutely right - Perl is not for everyone. To answer your question: "why perl?": It is the light in the wilderness, the diamond among all the rubies, it is the snake-stomping camel of Power, it ... it... just get's the job done.

    2. Re:why learn perl NOW? by Aim+Here · · Score: 1

      I totally dig the whole master-pupil, Perl-is-the-one-true-way, Zen enlightenment stuff, but when I'm around places like this on the net, I just get the feeling that Perl is just God's way of getting me to give all my money to the O'Reilly corporation - it strikes me that half the posts here are about which of O'Reilly's books are worth buying and which aren't. I just feel like I'm being a manipulated pawn in some sneaky corporate game with only one winner, or something (though I do admit that O'Reilly are quite nice and fluffy and cute, as evil corporate overlords go).

      For the record, I learned Perl via perldoc on the NT4 command prompt at work because it was a damn sight more fun to do, and even sometimes did the job better, than the Excel spreadsheets I was being paid to write. If you have some adolescent hormonal urge to stick it to the man, that's the way to learn perl...

    3. Re:why learn perl NOW? by Anonymous Coward · · Score: 0

      Amazing.... O'Reilly has become THE publisher for technical books so we should "stick it to" them. O'Reilly is one of my preferred publishers (there are many others, but I'd give O'Reilly the top mark) for rapid learning a variety of subjects.

      Depth and Width .... I'll take that anytime!

      As to your sugestion... FEH!

  32. Re:I wouldn't buy anything from this author by merlyn · · Score: 4, Interesting
    It takes an AC to make a libelous statement like that.

    I encourage you to review every article I've written there, and come to your own conclusion. I'll stand by my public record.

  33. Save Money by pmc258 · · Score: 1

    Save yourself more than FIVE BUCKS by buying the book here: Learning Perl, 4th Ed.

  34. Beginning Perl by Simon Cozens by systems · · Score: 2

    I am learning Perl using Beginning Perl
    And I am really satisfied with it, it's free, it's comprehensive and it's author is a skilled Perl hacker.

    I would like to know, what more does Learning Perl have to offer? (For one it's not free!)
    If it's depth, I plan to use the perldoc and perlmonks.org for the depth. And beginning perl just for the big picture (not that it doesn't offer depth, it does to a great degree).

  35. Re:Little Point Learning Perl If Not Already Learn by Anonymous Coward · · Score: 0

    I will not mention other languages... ... or back up your vague assertions with anything more solid than "because I said so".

    His statement needs no backing up. Anyone who has
    actually programmed anything major already *knows*
    there are better languages out there.

  36. Perl Runs Slashdot? by BSD-R-Me · · Score: 1

    I'm not sure if its still true but the last time I checked /. uses mod_perl and template toolkit to run most of the show.

    if ($php == 'Personal Home Page') {
    $code = 'good language to learn basics';
    }else{
    $code =~ s#(slashdot.org)#/.#;
    }

    --
    If exposure to C++ hasn't destroyed your ability to think logically, you should have no trouble with math. Leslie Lampo
    1. Re:Perl Runs Slashdot? by merlyn · · Score: 3, Insightful
      Yes, Slashcode is Perl.

      With respect to Rasmus, whom I've met on more than one occasion, I've often said:

      PHP is "training wheels without the bicycle"
      I'll leave it to you to discover why I say that.
    2. Re:Perl Runs Slashdot? by BSD-R-Me · · Score: 1

      To funny... the corrected code is below

      if ($php eq 'Personal Home Page') {
      $code = 'good language to learn basics';
      }else{
      $code =~ s#(slashdot.org)#/.#;
      }


      also the substitution could have been writen as:

      $code =~ s#slashdot\.org#/.#;

      no need to put the word into $1 if i'm not going to use it.

      PHP is "training wheels without the bicycle".
      Use it if mod_perl isn't available, but if you have a choice, learn something with power rather than scaffolding.
      Ahmen

      --
      If exposure to C++ hasn't destroyed your ability to think logically, you should have no trouble with math. Leslie Lampo
    3. Re:Perl Runs Slashdot? by humankind · · Score: 0, Troll

      Use it if mod_perl isn't available, but if you have a choice, learn something with power rather than scaffolding.

      Puh leeze!

      Perl was never designed for the web. PHP was designed from the ground up to be a web scripting language. As such, it blows the doors off of Perl in terms of speed, funtionality, ease-of-use, deployment, understanding and security. PERIOD.

      I love Perl. But Slashdot is an uber minority when it comes to selecting Perl as the real-time scripting language to use on the web. They've done a fine job, but if the application were written in PHP instead of Perl, it would likely perform twice as fast. No disrespect to Perl, but the sysops of this site are using the language outside of the environment for which it was designed.

      PHP is a fine language, and if you want to talk about the superiority of Perl over PHP, one area you do NOT talk about is real-time web-database applications, because PHP had Perl beat dead. Perl is a very powerful and useful language, but only crazy people use it in high-traffic, mission critical, real-time enviroments like ./ - Perl is designed more for offline processing.

      Next you'll be ranting about how great Java is.. ROFL

    4. Re:Perl Runs Slashdot? by lupin_sansei · · Score: 2, Insightful

      PHP being more secure than perl. You're joking right?

      Where's PHP's equivalent of perl's taint mode? Where's the PHP's equivalent of perl's "use warnings" and "use strict"? Where's PHP's equivalent of DBI's parameterised queries?

      And have you seen the amount of entries for PHP on bugtraq: http://www.securityfocus.com/swsearch?query=php&sb m=%2F&submit=Search!&metaname=alldoc&sort=swishran k

    5. Re:Perl Runs Slashdot? by BSD-R-Me · · Score: 1

      LOL get a clue, the quote I left is exactly that... a quote from someone else.

      I don't think php is "training wheels without the bicycle" I think php is a "bike with training wheels" it will help keep you from falling down but everyone can see that you are just learning to ride.

      There will always be a holy war over which language is better, you are not even worth drawing my sword. A simple look at your comments reveals this.

      --
      If exposure to C++ hasn't destroyed your ability to think logically, you should have no trouble with math. Leslie Lampo
    6. Re:Perl Runs Slashdot? by pudge · · Score: 3, Insightful

      Perl was never designed for the web. PHP was designed from the ground up to be a web scripting language. As such, it blows the doors off of Perl in terms of speed, funtionality, ease-of-use, deployment, understanding and security. PERIOD.

      Except, no, it doesn't. PHP is not faster. Most people say this when what they mean is that PHP has a smaller memory footprint, and can therefore handle more connections on a given machine. I will grant this, but we have no problem adding more hardware, as it is a negligble cost in the grand scheme of things.

      Functionality? Are you kidding? There's nothing PHP can do that Perl can't, but Perl can do much PHP can't.

      Ease-of-use, deployment, and understanding are in the eye of the beholder. I understand Perl quite well, thanks very much. That (hypothetical) you don't puts no obligation on me to stop using Perl.

      As to security: why is it that we are almost constantly seeing CSS and other vulnerabilities for Slash-a-likes written in PHP, but almost never see the same for Slash itself, which is written in Perl? Granted, it could be that PHP is more secure but Slash's programmers are just superior. :-)

      But Slashdot is an uber minority when it comes to selecting Perl as the real-time scripting language to use on the web. They've done a fine job, but if the application were written in PHP instead of Perl, it would likely perform twice as fast.

      Thank you. But no, it likely would not be faster, since the bottleneck is not Perl, but the database. You might contend that if we wrote it in PHP, it would take fewer machines to get handle the same number of queries, but that would mean using a language that we like less, are less familiar with, and which has a whole host of problems with functionality that we'd have to spend more time (read: money) to work around.

      only crazy people use it in high-traffic, mission critical, real-time enviroments like ./

      People keep saying that as if the facts -- for both Slashdot and LiveJournal, as well as others -- don't absolutely refute the statement.

    7. Re:Perl Runs Slashdot? by Dom2 · · Score: 2, Interesting
      I'm a Perl programmer. I love Perl. But there are a couple of things that PHP really, really does better than Perl (well, mod_perl in particular).
      1. Deployment. Getting stuff into mod_perl isn't as simple as it could be.
      2. Shared Nothing. mod_perl keeps stuff around between requests. This can be useful, but also limiting. In fact, it's been the cause of some of the weirder bugs I've seen. And it stops you deploying two copies of the same mod_perl application into the same server easily.

      Disclaimer: I'm not a PHP programmer, the above is just what I think happens. :)

      Of course, none of this matters for a big site like slashdot, or the ones I develop. But for small people who are just "playing around", it can be a big inhibitor. And that's one reason why I think mod_perl has lost mindset to PHP in the past.

      -Dom

    8. Re:Perl Runs Slashdot? by KnightStalker · · Score: 1

      Not much reason to escape the . in my opinion, unless you're likely to encounter 'slashdotborg' or 'slashdot@org' in your input :-)

      --
      * And remember, it's spelled N-e-t-s-c-a-p-e, but it's pronounced "Mozilla."
    9. Re:Perl Runs Slashdot? by TheLink · · Score: 1

      You don't like mod_perl? Use fast_cgi. mod_perl is useful if you really need to modify how apache behaves. But if you just want a faster version of CGI, try fastcgi.

      It's not as fast as mod_perl, since your program is now a separate process from apache and they talk via sockets or something, but if you're going to use perl or some other interpreted/bytecode language, the magnitudes of the speed difference aren't likely to be your main problem (the algorithms, architecture and hardware probably affect the speed more).

      PHP is really badly designed, only recently they've started fixing some of the stuff. But lots of the bad things are actually popular PHPisms - take them away and PHP starts to be as "difficult" as perl.

      For example stuff like magic quotes, track vars are STUPID and DANGEROUS and should never have been there in the first place. But they were made part of PHP and tons of ignorant/stupid people actually thought they were great and used them. addslashes is stupid too. Tons of sloppy thinking.

      --
    10. Re:Perl Runs Slashdot? by Dom2 · · Score: 1
      That's just the point. I really like mod_perl; it's just that some of the architectural decisions about it aren't quite right. They're great for performance, but not deployment.

      The trouble is that you can work around all of this, it's just not simple. PHP makes it simpler, despite all its other warts.

      -Dom

    11. Re:Perl Runs Slashdot? by BSD-R-Me · · Score: 1

      I escape it out of habit as a visual reminder to me that it is the literal period character so that when I come back to the code I know right away what I meant. Good eye you have :\

      --
      If exposure to C++ hasn't destroyed your ability to think logically, you should have no trouble with math. Leslie Lampo
    12. Re:Perl Runs Slashdot? by humankind · · Score: 1

      I love the language sycophants modding my post as a troll. They probably don't even program.

      I use Perl and I use PHP as well as many other languages and tools on a daily basis. They each have their place. Running Perl in a real-time, high-traffic environment is like running NT. It has too much overhead for the application's need and is overkill. PHP does many things far more efficiently than Perl. But Perl is incredibly useful in other areas. This isn't a one-language-is-better-than-another-language argument. It's about which tools work best for which processes. And along those lines, Perl is a hackjob for real-time web work. You can hack the API a thousand times to make it come close to being efficient, but in the end, you did a huge hack job to make a language do something it wasn't designed to do. That is the reality.

      I can take a pencil and use it to sew; I can spend a ton of time so that I can demonstrate that *I* can sew using a pencil faster than someone else using a needle. That doesn't mean that the pencil is superior to the needle for sewing. It means you have too much time on your hands and are wasting energy trying to shove a square peg into a round hole. Congrats you did it! Proves nothing.

    13. Re:Perl Runs Slashdot? by humankind · · Score: 1

      It's really disheartening to see so many "programmers" who are "language-centric". This seems to specifically be a problem for people who are into Java.

      Maybe the way they teach computer science is different nowadays, but when I went to school, we were taught multiple languages and the idea that no single language was ideal for every environment.

      As a result, I write code in dozens of languages based on the need of the application: C, C++, Perl, Java, Javascript, PHP, etc... Each has strengths and weaknesses. I resist the urge to say one language is dramatically superior (though if I had to make a choice, I'd say C/C++ is the best of all worlds). What I tend to see are people who have narrow experience limited to one set of tools, go rambling about the superiority of their designated choice without really knowing much about the other systems.

      What's ironic is you expect this from Java guys, who IMO seem to be the most tool-centric evangelists, but Perl has always been an intermediate language that was used by those working with more formal system in different languages. Perl is more of a compliment to other systems for generating reports and querying and parsing data.

      It just boggles me there is any substantive group evangelizing for Perl as a superior real time web platform. That's just nuts, but I have to assume a lot of these people don't know much about the alternatives. Then again, once you can understand Perl's goofy mnemonics, I think it goes to your head. That might explain some things, like why people speak Klingon.

    14. Re:Perl Runs Slashdot? by pudge · · Score: 0

      I love the language sycophants modding my post as a troll.

      Don't blame them: you're the one who said obviously incorrect things like "PHP is faster and more secure."

      I can take a pencil and use it to sew; I can spend a ton of time so that I can demonstrate that *I* can sew using a pencil faster than someone else using a needle. That doesn't mean that the pencil is superior to the needle for sewing. It means you have too much time on your hands and are wasting energy trying to shove a square peg into a round hole.

      Right, and you could use PHP for Slash. But it would be a mistake, because PHP is not nearly as good for large applications.

    15. Re:Perl Runs Slashdot? by chromatic · · Score: 1
      I have to assume a lot of these people don't know much about the alternatives.

      If you were less patronizing, you perhaps could believe that some of us have a lot of experience with the alternatives.

  37. Duh, you're on the wrong network by Anonymous Coward · · Score: 1, Interesting

    irc.perl.org. That is all.

  38. Re:I wouldn't buy anything from this author by John+Bokma · · Score: 1

    "Having encountered Randal L. Schwartz on PerlMonks I find him agressive, unprofessional, and unknowledgeable." I wonder who you are then, besides an Anonymous Coward...

  39. Re:I wouldn't buy anything from this author by Camel+Pilot · · Score: 4, Informative

    I just read the last 40 posts of one Mr Randal L. Schwartz on PerlMonks as per his link here and found none to be aggressive or unprofessional and instead helpful if not patient. Sorry AC you must have some axe to grind.

  40. Re:I wouldn't buy anything from this author by snorklewacker · · Score: 1

    He may have falsely impugned your credentials, but it hardly rises to libel. As another online acquaintance of mine said: "if there isn't some mentally deranged person yelling at you from the streets, you aren't really accomplishing anything in the world."

    Don't rise to the bait.

    --
    I am no longer wasting my time with slashdot
  41. CPAN - take a look by oo_waratah · · Score: 2, Insightful

    The reason I use and recommend perl over other languages is the useful INDEXED source of common modules called cpan.

    This single resource has saved me many hours of programming alone. More than pays for some of the obscure problems. Frankly it is up to the programmer to write good code, not the programming language. I can show you horrible code in about 20 different languages from Cobol to C to Java to Perl. Learn how to write and comment clearly and any language is a good language.

  42. Learning Perl is NOT a tome! by edunbar93 · · Score: 1

    "Tome" generally implies that a book is more-or-less comprehensive and rather thick. Learning Perl is more like a quick introduction. "Code Complete" is a tome. "Life with Qmail" is a tome. And "The C Programming Language", now *that's* a tome. "Learning Perl" is not in this class at all.

    --
    "No problem. I have the capacity to do infinite work so long as you don't mind that my quality approaches zero."-Dilbert
    1. Re:Learning Perl is NOT a tome! by jericho4.0 · · Score: 1

      "The C Programming Language" is what, 120 pages without the spec? Still, it's a tome alright.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  43. Re:I wouldn't buy anything from this author by Anonymous Coward · · Score: 0

    nope. you are fairly rude. hell you made a sig just to excuse yourself for being so. many people have told you too. man what a jerk

  44. Re:I wouldn't buy anything from this author by Anonymous Coward · · Score: 0

    Opinion is not libel.

    Based on this comment alone of yours, I now have to agree with him. You are a pompous asshole with an attitude problem.

  45. Regular Expressions by TrollK!ng · · Score: 1

    While this may be off topic if your really interested in learing about Regular Expressions the subject deserves more then just a chapter out of the pearl book. "'Mastering Regular Expressions" by o'reilly is an excellent book on the topic

  46. Line noise? by Anonymous Coward · · Score: 0
    print grep ord $_,map{y/a-zA-Z//d;$x.="+ $_";chr(eval $x)
    }'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l 21H13-a6-76
    c40k25er2wx8-y6z13-81'=~m#([^!\n]{3}) #g#tr/-0-9//d;print
    Nah.
  47. camel toe by Danzigism · · Score: 0
    i personally enjoyed the camel book.. i've always sucked at programming.. i understood regular basic programming and that was it, for such a long time..

    the camel book refreshed my memory and brought me to the basics of programming.. like learning about variables and arrays.. the book definitely gave me a good review on the concept of programming.. then it takes you right into examples, and practical uses.. i'll probably pick up this 4th edition.. sounds like a bargain..

    --
    *plays the Apogee theme song music*
  48. Re:I wouldn't buy anything from this author by slashnik · · Score: 1

    Good one Larry, had us going

  49. What was the problem with 1st Ed... ?! by jenesuispasgoth · · Score: 1

    I've begun programming with Learning Perl 1st Ed, almost 8 years ago. I was a highschool student then, and had almost no programming experience (which is to say : I had learned how to program a bit of ASM for a Motorola 6809 chip, which had 2 registers only, so you couldn't do much complex programming with it).

    I litterally learnt how to program and - even more important - how to think before beginning to code thanks to the Llama Book.

    When later I began my CS studies, programming wasn't a problem at all.

  50. Re:Little Point Learning Perl If Not Already Learn by roju · · Score: 1

    Repectfully disagree. For some people, programming languages are just one small tool of many, rather than being the focus of the job (e.g. scientists).

    Suppose I have several large datafiles, and I need a subset of the data from all of these in a different format. Perl is the best tool I've found for dealing with that. Variations on perl -ne 'print if /some_regex/' have saved me loads of time to do other, more interesting things. Call it a glorified awk or sed, but it's a huge time-saver.

  51. Re:Little Point Learning Perl If Not Already Learn by smash · · Score: 1
    Erm.... I just started learning perl this week to administer active directory.

    The win32 modules shit all over vbscript or command scripts for messing with AD :D

    So there's a use for people who don't know it yet - i'm sure there's plenty more.

    smash.

    --
    I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
  52. Re:Little Point Learning Perl If Not Already Learn by hondo77 · · Score: 1

    ...from a professional standpoint, unless you have to maintain some legacy system that uses Perl, or an interest in historical programming languages, there is very little point in learning Perl.

    From a professional standpoint, there are plenty of open positions at the very large company I work for that call for Perl in new development projects. Methinks your bias is showing.

    --
    I live ze unknown. I love ze unknown. I am ze unknown.
  53. Mod parent up by metamatic · · Score: 1

    I also think Perl 6 is a mistake, and I'm not going to post anonymously. After years of writing Perl, I've switched to Ruby after seeing the direction Perl 6 was going in.

    I always felt that Perl 5 needed some drastic cleanup and simplification. I never got the hang of writing proper OO libraries, because it was so painful and non-obvious. While that's somewhat fixed in Perl 5, there's a whole new load of complexity being introduced.

    I don't want variables to have different syntax depending on whether they're object variables or normal variables. I don't want method dispatch to maybe follow different rules to inheritance. I don't need MetaClass and Class to be separate things in the language; I'm quite happy for it to be turtles all the way down. And most of all, I don't need full regular expression interpolation in freakin' package names!

    I realized that not only is it really hard to make something complicated and powerful into something simple and powerful, it's also not Larry Wall's direction for Perl 6. A new piece of syntax for private methods as well as a private trait, and they work slightly differently? Methods which are either class methods or object methods depending on what the calling code does? The man certainly has a talent for introducing gratuitous complexity.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    1. Re:Mod parent up by chromatic · · Score: 1

      Try writing Perl 6 code. Try porting Perl 5 code to Perl 6. I did. You can read about it tomorrow afternoon on Perl.com.

  54. Re:waiting for MS's perl.NET to be released! by bubbaD · · Score: 1

    I suppose if it were Perl 6, it would be funnier, because the parrot virtual machine is atttempting to do a few of the same things as CLR. http://www.perl.com/pub/a/2002/03/19/dotnet.html
    I made this attempt at humor about Python and Perl flamewars, which started early here, because both groups tend to also be "open source" purists, and I find it funny that evil empires' borg-like platform embraces both languages. I also noticed that despite having the book, you don't claim to be using it! ;-)

  55. Other copies by stevebenson · · Score: 1

    Well I read The Camel Book and had to read it 3 times before I understood half of what it was saying. I am looking forward to picking up this new copy but wonder if they make a audio version or video version? And if so the link where I can pick it up. Thanks for any help on this issue.