Wednesday, June 10, 2009

Easy as Perl

I modified the Source-Stat collection programs to accept command-line options for the host name, database name, and project name. The modifications were easy. Very easy. The GetOpts::Long package does the heavy lifting; all I had to do was include the package, define the options and their container varaibles, and call a single function.

The ability to add functionality this easily comes from CPAN, the collection of Perl libraries. Knowing what is in the library is the trick; I stumbled across this library. I've written a number of Perl programs in the past few years; I wonder what things I have built that were already available. Time to go looking for an index into CPAN.

No comments:

Post a Comment