Forrest's Tech Blog

04/16/06

The Power of Perl

Filed under: code, perl — forrest @ 09:16:49 pm

Perl is a much-malingned as a write-only language by those who don't know it, but they just don't understand the power.

Here's a little anecdote which should clear things up:

In a late morning meeting at work, I learned that there was some document corruption problem which was rare and difficult to catch, which showed up in our pdf documents as a double question mark ("??"). Although I only know very little about the pdf format, I said "Oh, I bet I can write a perl program to detect that!"

When I got back to my cube, I searched CPAN for "pdf" and spent about half an hour going over my numerous pdf library choices before finally settling on CAM::PDF.

Extracting text from the pdf was then a piece of cake, and of course searching for "??" is a trivial matter for perl's famous regular expressions.

By the end of that day I had a working program. That's the power of perl.

Comments

  1. Regular expressions in general are awesome. I must admit, perl was not the first thing I thought of in conjunction with RegEx though.

    btw - trying out your Hanzi quiz but many characters in Firefox are ??, oddly enough. Is there a font set I need to see the Chinese? I've been tinkering with learning Mandarin since last December.

    Comment by Jerry Carter [Visitor] · http://datatribesoftwerks.com — 07/29/06 @ 14:11

Leave a comment

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>


Options:
(Line breaks become <br />)
(Set cookies for name, email & url)

powered by  b2evolution
This skin features a CSS file originally designed for WordPress (See design credits in style.css).
Original design credits for this skin: Ben de Groot
In order to ensure maximum compatibility with WP CSS files, most b2evolution features that do not exist in WP are hidden from this generic wpc_* skin.