Whenever possible: Do it once

| September 22, 2011

We’ve been trying to deliver a custom report for a client using another system that has been long neglected. Of course we were also trying to do it in a way the original designers did not plan for. In a good state it was taking 3.5 hours to run. In a bad, up to 22. […]

The old adage on regular expressions

| September 5, 2011

A co-worker is fond of saying, “You have a problem so you solve it with a regular expression. Now you have two problems.” Regular expressions are powerful tools but they can easily cause unforeseen complications. The script I’ve been trying to improve contains a section for stripping HTML. It uses HTML::Strip to do this but […]

Let’s take the shortcut

| September 5, 2011

In my continuing adventures with legacy code I’ve come across a couple mistakes that I can only figure came from someone who didn’t really know the language. I have to extract information from several large gzipped files. These files will be filtered for specific IDs and the results kept in a new file. A pretty […]

Bad slipup with ternary operators

| September 1, 2011

I’m a fan of ternary operators. I’ve seen some people complain that they make code less readable but I don’t agree. I suppose it’s fair to say it’s not as plain to scan through but I think any decent programmer should understand them. The other day, however, I came across a legacy one in our […]