http://www.perlmonks.org?node_id=180168


in reply to So I'm in a bit of a quandary

I probably wrote that bad code. (laughs nervously)

During my first contract, as a "Junior Perl Developer", I was assigned to write a large monolith of code based on previous code snippets. This was a mission-critical program, and I had a short time to work on it. I mean, I made it ugly, complete with globals, inefficient passing of "private" variables (by value), the whole works. After the code went into production, I learned my folly: the server (a rather fast Sun box) was swamped, processes died and sat around in memory, the Oracle db was swamped with inefficient requests and half-open connections (a code snippet the bossman wrote apparently opened a new db connection with each query -- a fact that to this day gives me a satisfactory laugh. What's even more sad is that almost two years later, this bloated, naively-written chunk of code is still in production.)

By the end of things, I had discovered the value of -w, "use strict", and taint-checking, and was in the process of refactoring the code when the good boss, out of God(-complex)-like love, decided to cancel my contract and send me on my way back to my agent. Oy.

My suggestion is to rewrite your code using good OO concepts and resiliency checks, and test it on an office test server. Anything that's required try writing as a new module. If you have to make this a hobby project to do during your "down time" between other projects, then go ahead.

Bossman may just put a gold star on your report card.

-Shawn
(Ph) Phaysis
If idle hands are the tools of the devil, are idol tools the hands of god?