What got me hooked on Perl?
Well rewind a few years to a fresh faced student graduating from university with no real language to call my own. I moved through the usual suspects VB, ASP, dabbled a bit with C until finally I got my first real job.
After working with VB for a couple of months I got asked to help out with a new project, a funky new XML converter. The traditional route for this company would be to write the converter in C, however somebody had suggested trying out this Perl language as it is supposed to be good with text. So there I was the junior developer pitted against the senior C guy. Thanks to the CPAN I had a working converter in a surprisingly short amount time. The C guy had barely started.
While I was waiting for the C guy to finish his code I set about hooking my script into apache, no need to write your own preforking server is there? That didn’t take long so it was onto the load test. This was a disaster. The server couldn’t handle anywhere near the throughput we needed. The C guys nodded “thought as much” and to be honest I had thought this was all to good to be true, but not one to give up I carried on digging and searching.
mod_perl. Its not my fault I hadn’t heard of it before, I was new to this Perl thing. Now that I had a shiny mod_perl server setup it was time to restart the load tests. While not a disaster there was a serious issue with memory use. Again not one to give in easily I did a bit of fine tuning and, more importantly, discovered you can preload modules and get the full benefit of memory sharing.
By this time the C version was ready and the head to head started. To everybody’s surprise, even mine, the Perl running under Apache and mod_perl performed as well as the C version. Different variations of the tests were run but the results were the same.
The benefits of using Perl were clear, I had delivered working code in a fraction of the time to code in C and the performance under load had been so close as not to matter.
My love of Perl had started.