|Think about Loose Coupling|
Perl for admin tasksby gmax (Abbot)
|on Feb 09, 2002 at 09:22 UTC||Need Help??|
The latests Freshmeat's editorial is an interesting discussion about building software. Among other pieces of sound advice, there is one in particular that I like:
I automate virtually everything. In fact, an extremely complex Perl script is writing this article for me. I'm really asleep...
Reading these lines, and similar examples later in the same article, reminded me that I am basically using Perl for its original purpose, i.e. as a tool for administrative tasks, especially automating the boring (but most important!) ones .
As a database administrator, I appreciate the virtues of Perl. Whenever I realize that I am typing the same task twice, my mind starts transforming that task into a Perl script.
As a database designer, I often need to analyze existing chunks of horrible data in order to mutate them into a reasonably businesslike database. Really an enjoyable job, if you like the idea of extracting usable data from a pack of junk in a monster flat file. :) In these chores, Perl is absolutely invaluable1. Before embracing Perl, I used to meet these needs with C (Don't worry. I am cured now, and the doctor said it wasn't infectious.) Although my tools of the trade were fit for the purpose, it wasn't that easy to adequate a program to solve problems that were slightly different from the original ones.
With Perl, I can often change the whole task by replacing or modifying a regular expression in my code while in C I was sometimes forced to more committing an unpleasant structural changes.
Moreover, although I don't use Perl to produce full (web based) clients, I have perl scripts working in the shadow of traditional client-server applications, doing integrity checks, cleaning data, building statistics summaries and so on.
There's More Than One Way To Do It, and Perl has almost all of them.
update Corrected a typo (thanks dws). s/unvaluable/invaluable/. It could have been interpreted as if I despise Perl! :)
_ _ _ _ (_|| | |(_|>< _|1 <free ad>If you don't trust my word for it, there is a book that might impress you better.</free ad>