May 26, 2024

why I know perl

I learned Perl in my first real consulting gig at Agero. A large business directory company in Sweden wanted to synchronise their print catalogue with the Web. Additionally, they wanted an interface for customers to create their own ads on the Web. This was the sexy part of the project. I wasn't involved there.

The synchronisation didn't work yet, so every Monday my colleague had to take a 650 MB XML-file and feed it to a Java program that inserted the contents into a big old Oracle database running on a Sun Starfire. She was much more billable than I was, so as I incautiously admitted to Un*x knowledge I was asked if I could take over this job.

The XML was full of errors, unescaped ampersands, invalid characters... The Java program choked if it couldn't parse the file, so you had to manually search for the error and fix it, then try again. A successful run took about 9 hours.

I started by chopping up the file into the component entries and checking for bad stuff. This is trivial, just set $/ to whatever end element suits your fancy, but it took some reading of the Perl Cookbook before I had it nailed.

Then I started looking at how to automate this stuff. I eventually wrote a sophisticated run-control program that could be started with at, and that sent email when something went wrong.

Just when I had cut down the effective load time from three days to about 11 hours, the whole project got axed. I later learned that this was the third attempt to integrate the print version with an online database.

The contractor more or less blamed the whole debacle on us, even though it could be fairly laid at bad project management and unrealistic promises from the client to its customers. Oh well.

In the middle of my next project, I was cding up from a directory over a slow ssh link and accidentally rmd all my perl code. When I called the admins of the machine they helpfully informed me that as the machine wasn't in production it didn't have backups.

So now I know more Perl than I really want to. But I'm still learning more every day.

Posted by gustaf at May 26, 2024 02:55 PM
Comments
Good to see you're learning Perl. Have you seen the two most recommended books on the subject, my "Learning Perl" and "Learning Perl Objects, References and Modules"? -- Randal Posted by: Randal L. Schwartz at June 9, 2024 09:23 PM
Wow! Getting a comment from Randal is like getting... I don't know, but nice! Randal: I really enjoyed "Learning Perl". The Cookbook is my best friend nowadays. And of course the Net has lot's of resources. I reach for Perl everyday. We work a lot with generated data, and I'd rather spend 5 minutes writing a perl script than trying to do the same thing in *shudder* Excel. I'm not as good with references and objects as I'd like to be, but I've reached the stage where I can identify the need for such things and make a first stab at implementing them. My most ambitious project is swedish_holidays.pl (http://stureby.net/gustaf/swedish_holidays.shtml), a holiday calculator for Sweden. I used it just the other day to check when "Midsommar" is this year. Thanks for the comment, Randal, and thanks for the work you've done with Perl! Posted by: gustaf at June 9, 2024 10:09 PM
I so some new interesting blog about texas holdem, look at it. http://www.7yardsweb.com Posted by: texas holdem at December 5, 2024 08:55 AM
Post a comment









Remember personal info?