LWN.net Logo

Five Ways to Improve Your Perl Programming (O'ReillyNet)

brian d foy discusses methods for improving Perl code on O'Reilly. "Inside every tangle of obfuscated Perl code is a clean, well-architected gem struggling to emerge from its cocoon. brian d foy has spent a lot of time thinking about this for his new book, Mastering Perl, and has come up with a Top Five list of things that every Perl programmer should be thinking about when writing code."
(Log in to post comments)

Perl still worth it?

Posted Apr 19, 2007 12:40 UTC (Thu) by ldo (subscriber, #40946) [Link]

Is it still worth spending much time improving one's Perl skills? These days I'm doing more stuff in Python (I did make a brief foray into Tcl, but let's not go into that :).) It's just when I look at all this weird stuff with reams of underscores and other funny characters all over the place, my eyes just glaze over...

Perl still worth it?

Posted Apr 19, 2007 17:39 UTC (Thu) by vmole (guest, #111) [Link]

As much as I prefer Python to Perl as a programming language, I still find it easier to whip out one-off file trawlers in Perl, mostly because of the builtin regexps. Of course, far too many "one-offs" end up as mission critical scripts, and then you're screwed.

Perl still worth it?

Posted Apr 20, 2007 19:55 UTC (Fri) by jdivine (guest, #18042) [Link]

I clicked on the "comments" link purely to see if there would be the typical snarky "Perl is dead, or should be" comment. Glad to see there are still some things one can depend on.

I've spent the past four months working on a large Python project and I have a great appreciation for Python. But I still use Perl on an almost daily basis -- in many cases, something that can be done in 10 lines of Perl would require several times that in Python. And those 10 lines don't need to be an unreadable ASCII explosion. That's the point of articles like this.

Perl has its flaws; don't get me wrong. But Perl is also very succinct and powerful.

Re: Perl still worth it?

Posted Apr 23, 2007 21:08 UTC (Mon) by ldo (subscriber, #40946) [Link]

...in many cases, something that can be done in 10 lines of Perl would require several times that in Python. And those 10 lines don't need to be an unreadable ASCII explosion.

I'm curious. Can you give an example or two of this?

Re: Perl still worth it?

Posted Apr 24, 2007 0:39 UTC (Tue) by jdivine (guest, #18042) [Link]

You're curious? Try searching Google.

The point is, Perl's excellent regex integration and text processing shortcuts (probably the exact things that make many view it as "line noise") make it an excellent tool for certain tasks. Can Python also accomplish these tasks? Certainly. With the same amount of effort? I suppose that depends on your comfort level with the two languages.

Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds