Saturday, March 3, 2007

Write Perl Script

I did some Shell and Tcl script designing before but apparently it's not enough to write a good backup script. Before starting to play with scripts, I need to decide which script language to use, Tcl or Perl. I searched for 'comparison tcl perl' and got some interesting comments.

Tom Christiansen has a nice comparison. From his view, Perl is a good system programming language while Tcl is a metalanguage. (Metalanguage means that you can create your own language based on it.) Perl is also much more efficient because the intepreter first compile the code and run the intermediate code. Also because of compiling, it's more robust.

I would say that perl is a language designed for high-level, portable, systems programming on tasks of small to medium scope, but with support for enough underlying general-purpose programming constructs to make it suitable for many users who would not characterize themselves as systems programmers. This includes not just systems administrators but also people doing software installations, rapid prototyping, generic data munging, simple client/server programming, customer support, and test suite design and analysis. Another application area for which perl provides an elegant and convenient solution is one which is growing so fast that I suspect even its second-derivative is still positive: World Wide Web script support (a.k.a. CGI programming). I suspect than in a few years, perl may well be better known as a CGI language than it is as a sysadmin language.
(From http://www.perl.com/doc/FMTEYEWTK/versus/tcl-discussion.html)

For me there are two other advantages: similarity to C and that my colleagues know Perl. Richard Stallman is negative to Tcl either from experience of Emacs development. So conclusion is clear now. I choose Perl.

There are quite some free Perl readings on Internet. I downloaded a tutorial called PickupPerl. It's a good reading to start although it can be more compact. Start to read it and backup application is a good exercise.

No comments: