Perl Hacks: Tips & Tools for Programming, Debugging, and Surviving |
| | | |
This book is also available, brand-new, from 3rd-party marketplace sellers at Amazon.com, from $16.75. | The HTML code below can be pasted onto your web-site, your MySpace page, or blog - or any number of similar places - to create a link to this page: If, instead of a text link, you'd like to create a link to this page which will display the book cover, if it's available, then the code below will do exactly that:
Check for the same book at these other US book sites:
[ Abebooks ] [ Alibris ] [ Barnes & Noble ] [ Half.com ] [ Powells ] … or check UK bookstores | Editorial Review / Publisher's Information:
Product Description With more than a million dedicated programmers, Perl has proven to be the best computing language for the latest trends in computing and business. While other languages have stagnated, Perl remains fresh, thanks to its community-based development model, which encourages the sharing of information among users. This tradition of knowledge-sharing allows developers to find answers to almost any Perl question they can dream up. And you can find many of those answers right here in "Perl Hacks," Like all books in O'Reilly's Hacks Series, "Perl Hacks" appeals to a variety of programmers, whether you're an experienced developer or a dabbler who simply enjoys exploring technology. Each hack is a short lesson--some are practical exercises that teach you essential skills, while others merely illustrate some of the fun things that Perl can do. Most hacks have two parts: a direct answer to the immediate problem you need to solve right now and a deeper, subtler technique that you can adapt to other situations. Learn how to add CPAN shortcuts to the Firefox web browser, read files backwards, write graphical games in Perl, and much more. For your convenience, "Perl Hacks" is divided by topic--not according to any sense of relative difficulty--so you can skip around and stop at any hack you like. Chapters include: Productivity Hacks User Interaction Data Munging Working with Modules Object Hacks Debugging Whether you're a newcomer or an expert, you'll find great value in "Perl Hacks," the only Perl guide that offers something useful and fun for everyone.
| Other Items You May Enjoy: Browse Books From These Related Subjects: Customer Reviews:
Do Perl Or Die - $@ 18 November, 2006 In a time when new computer languages are dime a dozen, perl unquestionably retains its beauty. Keeping with the philosophy of perl - there is more than one way to do it - the book shows you ingenious ways to work with this powerful language. This is a true hacks book and meant mostly for the advanced user. Before reading this book, I didn't even realize what I didn't know and I rate myself just short of contributing to CPAN. Even if you have read all the popular books - Perl Programming, Perl Best Practices etc. you'll still find a lot of gems.
Simply put if you like perl, you'll love this book. Welcome to the next level...
- Reviewed by customer ID: A38BL2TNC3QUI1
A Great Collection Of Perl Tricks 09 February, 2007 I received this book as a token of appreciation for my contributions to
the 2006 Perl Advent Calendar. It's the first book I read as part of the
O'Reilly Hacks' series of books, and it proved to be a light yet informative and entertaining
read.
The book covers various useful "hacks" or small tricks that allow one to
achieve a lot of cool tasks when working with Perl. These tricks are unorthodox
and stretch the limit of one's Perl knowledge. Since they require an advanced
knowledge and understanding of Perl, I would recommend this book only for Perl
experts. Some of the B:: using modules were even too high-level for me to
understand how they worked internally. However, I understood the purpose of the
code in all cases, even if I didn't understand the code itself.
So it is a recommended read for people who've worked with Perl a lot,
and wish to learn many new and useful tricks. Perl Hacks for Perl hackers,
indeed!
- Reviewed by customer ID: A1WKIUIDMQGHVP
Excellent Compendium Of Perl Tricks 21 November, 2006 To be completely honest, this isn't the book I thought it was going to be. Most O'Reilly Hacks books start off pretty simply and in a few chapters take you to the further reaches of their subject area. Whilst this is a great way to quickly get a good taste of a particular topic, it has the occasional disadvantage that for subjects that you know well, the first couple of chapters can seem a bit basic. As I know Perl pretty well, I thought I would be on familiar ground for at least half of the book.
I was wrong.
Oh, it started off easily enough. Making use of various browser and command line tools to get easy access to Perl documentation, creating some useful shell aliases to cut down typing for your most common tasks. "Oh yes", I thought smugly to myself, "I know all that". But by about Hack 5 I was reading about little tweaks that I didn't know about. I'd start a hack thinking that I knew everything that the authors were going to cover and end up frustrated that I was on the tube and couldn't immediately try out the new trick I had just learnt.
It's really that kind of book. Pretty much everyone who reads it will pick up something that will it easier for them to get their job done (well, assuming that their job involves writing Perl code!) And, of course, looking at the list of authors, that's only to be expected. The three authors listed on the cover are three of the Perl communities most respected members. And the list of other contributers reads like a who's who of people who are doing interesting things with Perl - people whose use.perl journals are always interesting or whose posts on Perl Monks are worth reading before other people's. Luckily, it turns out that all these excellent programmers can also explain what they are doing (and why they are doing it) very clearly.
Like all books in the Hacks series, it's a little bitty. The hacks are organised into nine broad chapters, but the connections between hacks in the same chapter can sometimes be a bit hard to see. But I enjoyed that. In places it made the book a bit of a rollercoaster ride. You're never quite sure what is coming next, but you know it's going to be fun.
In fact, the more I think about it, the more apt the fairground analogy seems. When you ask Perl programmers what they like about Perl, you'll often hear "fun" mentioned near the top of the list. People use Perl because they enjoy it. And the authors' enjoyment of Perl really comes through in the book. It's obvious that they really wanted to show people the things that they thought were really cool.
Although I did learn useful tips from the earlier part of the book, it was really the last three chapters that were the most useful for me. Chapter 7, Developer Tricks, had a lot of useful things to say about testing, Chapter 8, Know Thy Code, contains a lot of information on using Perl to examine your Perl code and Chapter 9, Expand Your Perl Foo was a grab-bag of obscure (but still useful) Perl tricks.
So where does this book fit in to O'Reilly's Perl canon? I can't recommend it for beginners. But if you're a working Perl programmer with a couple of years' experience then I'd be very surprised if you didn't pick up something that will be useful to you. And don't worry about it overlapping with other books in your Perl library - offhand I can't think of anything in the book that has been covered in any previous Perl book.
All in all, this would make a very useful addition to your Perl library.
- Reviewed by customer ID: A2BLY02P03LMAI
An Excellent Way To Get More Out Of Perl Than You Ever Realized 28 October, 2007 Perl is my workhorse language. I've written more Perl code, both personally and professionally, than any other language I've learned. Whenever I receive a new project, I immediately think of how I would accomplish it quickly in Perl. I've also been a fan of O'Reilly's "Hacks" series of books. When I heard of the marriage of Perl and O'Reilly's "Hacks" series in the book Perl Hacks, I knew I had to pick up a copy. It was a match made in heaven. The nature of Perl for terse, yet powerful constructs, and the hackish nature of the "Hacks" series makes for one of my favorite books in this series. The collection of articles in Perl Hacks are great for putting more productivity into your programming experience.
Those of you not familiar with O'Reilly's "Hacks" Series may need an introduction. The "Hacks" Series is an ever-growing set of books with focused attention on a particular topic, like Astronomy, Mental Improvement, or even Halo 2. The books are generally short, and contain article-length "hacks" of varying difficulty, noted by a thermometer next to the hack number and description. These "hacks" fall into several categories; the non-obvious solution to a problem, the performance improvement, and the "gee, I didn't know it could do that" oddity. What makes this series special compared with other books is the willingness to "void the warranty" on a particular product, and get straight to the internals, whether they lay in hardware or software. If something can be made better by opening the covers, or twiddling with the program layout, then its eligible for inclusion in these books. The series lends itself to a wide range of topics, and the format is great for a quick read, or for (my favorite) just randomly opening the book and reading what's there.
Perl Hacks is not a book that you'd find yourself reading straight through (although you do want to make sure you visit every hack in the book at least once). The book is divided into nine chapters: Productivity Hacks, User Interaction, Data Munging, Working with Modules, Object Hacks, Debugging, Developer Tricks, Know Thy Code, and Expand Your Perl Foo. There are 101 hacks in this book, ranging from the simple (Reading files backward, or managing your module paths) to the truly perverse (Replacing bad code without touching it by substituting the system-wide exit call with your own[...]. Each hack title is listed in the table of contents, with both the page number and the hack number. Each hack contains a graphic of a thermometer next to the number to show the relative difficulty of the hack (higher temperatures = more difficult hacks). There quite a variety of hacks placed throughout the book. Not once did I feel that the book was padded with something that really didn't belong in the book. If anything Perl Hacks opened my eyes to things that I would never have thought to do, but could easily see as being useful. I wouldn't have thought to create my own personal module bundles for moving my Perl programs between machines (I've always done it the old fashioned way: run, cpan install, repeat), but hack #31 makes it so "of course" that I'm thinking of including this in all of my Perl code that I ship. Hack #74 shows how to trace all of the modules your program uses (and all of their modules, too). Hack #52 is a simple hack ("Make Invisible Characters Apparent") but I can see this saving a developer or two some time when figuring out why their code isn't behaving properly. Of course, not all hacks in the book are productive (at least, not while you're programming). Hack #37, "Drink to the CPAN" is a drinking game you and your Perl buddies may want to try.
Perl Hacks is a short book, at less than 300 pages, but it's loaded with incredibly useful information. Much like the "Perl Cookbook" (also from O'Reilly) you'll find lots of useful items hidden in their pages. Many times I started with one hack, and finished the chapter reading the rest of the hacks because there were just that interesting. Perl Hacks is highly recommended for any Perl programmer to have on their programmer book shelf. Sure, you might be able to find some of the hacks out there on the net, but I think you'll find as I have that this is more of a go-to reference for finding out some of the more interesting corners of Perl.
- Reviewed by customer ID: ABCMKQDE4UZAO
Super-advanced Perl 21 July, 2007 From the title, I wasn't quite sure what to expect from Perl Hacks. Was it going to be about rummaging around in Perl's internals? Making Perl do clever, yet ultimately dumb and pointless tricks? It turns out that, while there is some fairly voodooish material here, some of it quite playful, on the whole it's a very practical book. Aimed firmly at the advanced Perl programmer who knows when it's appropriate to mess about with the symbol table, temporarily turn off warnings, or crack out one of the B:: modules, this is a collection of 101 suggestions to improve your productivity, boggle your mind about what Perl can do, or both.
The content reminds me a little of the likes of Exceptional C++ Style, a mixture of advanced best practices, and things which you may not need to know, but you'll probably still be interested in finding out how it works. For instance, have you ever considered tieing an array or hash variable to a function? Ever wanted to name a supposed anonymous subroutine? Print out the source code as well as the line number of a syntax error? Nor me, but Perl Hacks shows how it could be useful. These are illustrative of the spirit of the book.
My favourite material was probably the chapter on modules. Included are how-tos for outputting all the modules used in a package, automatically reloading modules in running code, shortening long package names with the CPAN 'aliased' module, and making up your own bundle of modules for easy installation. There's also an interesting object chapter with subjects such as: inside out objects, using YAML for serialisation, using traits and autogeneration of accessors.
Additionally, there's a little on using those scary B:: packages, using modules which use the B:: packages or other dark magic (e.g. peeking inside closures), some fairly hardcore tracing and profiling, that touches on some Perl VM internals. Also worth mentioning is the hack that hijacks the angle bracket glob operator to create Haskell/Python-style list comprehensions.
You are going to have to be one scarily gifted Perl hacker not to find something useful or at least thought-provoking at regular intervals throughout this book. My only complaint is that the hack format, which the blurb on the back of the book describes as a "short lesson", does not lend itself equally well to all hacks. While I liked the chapter on objects, some of the hacks (in particular the traits hack, some of the testing material) were too short.
If you like the sound of a book that's somewhere between Perl Cookbook, Perl Best Practices and the second edition of Advanced Perl Programming, you're going to love this.
- Reviewed by customer ID: AG2GXOJ468FLK
|