[Ottawa-pm] In defence of Perl..

allan.fields at gmail.com allan.fields at gmail.com
Wed Feb 9 06:26:28 PST 2011


Or why I still choose Perl over Python.

    Despite the wide spread publicity and high-profile proponents in press proclaiming Python the next generation language for the new millennium and allure of the Python band-wagon.  I aint switch-in'.  I may use Python on Linux, but I prefer to write familiar/flexible Perl.

    What recently raised my concern was a 2000 era Linux Journal article detailing Python as the new kernel configuration language and how the author justified it.

    While I care not, that the authors found Python handy for this purpose and encourage people to use the right tool for the job; I will suggest that it is bad form for critics of Perl, based on code quality or maintenance issues to disqualify Perl as a language, when often times Perl developers responsible are not given to properly maintaining the Perl code anyway.  It's this maintenance which when done right, can help people effectively use Perl, code-style counter-arguments aside.

    While many will argue Perl is a scripting language whose time has passed, I will suggest the current reality is quite different.  Perl is both still in use heavily, practical for Enterprise use and ready for both basic and advanced tasks alike.  Inside Government in Ottawa Perl is being actively employed for many projects.

    It can be used with ease to solve what even eludes the others, module and perl interpreter general availability is a strength of Perl for business use.

    Python and Ruby may have made strides since early releases as far as modules available, etc.  And from time to time you hear rants about CPAN breakage which at one point was admittedly a problem for the perl community.  However, I have found recent releases of Perl 5 have been rock solid across all platforms with an excellent history of release engineering.  
    Mean-while Perl authors have silently maintained a huge installed base of modules, which can solve almost any complex automation or data-processing problem for a minimal cost in complexity and time.

   A good site I like to search for snippets is http://perlmonks.org, if CPAN alone isn't an invaluable resource, then likely you'll find some kind sole solved it already for the lazy or perl adverse.  Notice, a fright of white-spaces and snakes is not necessarily a bad thing when climbing up the Perl ladder.  Sophisticated, flexible code is only a few subs away.

    Recently, I was involved in a script which required to do IP Subnet/CIDR. Calculations with-out modules (minimal install).  I found an article on Perlmonks which helped me do the bitmasking, but I still had to think rather than copy+paste.  It is the time that these invaluable resources save you that add to the Perl community appeal.

    This can count big time in the Sys-Admin space, as going from A-B and reporting on it is simple.  Have to parse routes in network multiple formats?  np.  I have saved countless hours with account management when Perl provides the missing piece of the puzzle.

    In a practical sense, perl scripts are responsible for maintaining a large part of the web infrastructure in use today, if not on the front-line, in the office when serious data processing tasks mandate an effective solution.

    If it looks like line-noise, perhaps they didn't understand the language syntax and proper program structure.  Or perhaps developers where under pressure to deliver a quick hack-up glue script just like those common bourne install scripts which people rush out the door at the last minute.

     Quick scripting is perhaps OK provided they aren't in it for the long term.  But it can all add up, just as in any code-base.   In the kernel dev community I can't blame them either way, because I know developer time is valuable, but arguable perl is still an excellent make tool, with many Open Source projects relying on it, to this very day.

Disclaimer: I've been a long time proponent of Perl and attended earlier YAPC.

# Long Live Perl.
use Perl;

Sent from my BlackBerry device on the Rogers Wireless Network


More information about the Ottawa-pm mailing list