The Guru College

Today’s Perl Lesson: An Axe Murderer Lives Next Door

If you write in Perl and you don’t use PerlTidy, I hope you are a meticulous and anal-retentive person. I hope you take extreme care to see all your text editors to override the “tab” key and to insert 4 spaces instead. I hope you use consistent line endings, consistent variable names, and for Pete’s sake, I hope you comment your code.

This comes up because the check_flexlm plugin that we have been using is… bad. Whoever wrote it violated the violent psychopath rule:

Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.

%30 of the code in the 220 line perl script had been commented out for no documented reason. It was just commented out. The author also didn’t turn on use warnings, so a lot of subroutines were defined twice. They didn’t know how to print arrays properly, use hashrefs, apparently had never heard of PerlTidy… and the list goes on. I finally had to scrap the old check and rewrite it. It took all of 4 hours to make the new check, including the wasted time trying to figure out the old one and doing some testing to see how lmutil actually works.

If donating code I’ve written while working for my current employer wasn’t so hard, I’d just post the new check here.

Sensor Cleaning | Home | Bits, Not Atoms