Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!dkuug!freja.diku.dk!rimfaxe.diku.dk!thorinn From: thorinn@rimfaxe.diku.dk (Lars Henrik Mathiesen) Newsgroups: comp.unix.shell Subject: Re: What is 'expect' Message-ID: <1990Nov22.164147.22894@diku.dk> Date: 22 Nov 90 16:41:47 GMT References: <1990Nov13.212403.11129@iwarp.intel.com> <7316:Nov1408:33:0390@kramden.acf.nyu.edu> <108721@convex.convex.com> <1990Nov15.054937.27996@midway.uchicago.edu> <5808@stpstn.UUCP> Sender: news@diku.dk (The Netnews System) Organization: Department Of Computer Science, University Of Copenhagen Lines: 45 lerman@stpstn.UUCP (Ken Lerman) writes: >In article <1990Nov15.054937.27996@midway.uchicago.edu> goer@quads.uchicago.edu (Richard L. Goerwitz) writes: >[...] >Shouldn't you write:.........................then I will most definitely > want to use it in place of OTHER ugly conglomerations of sed, awk, and sh. >No, I am not disparaging perl, because I don't know enough about it. >But from the little I know about perl, I don't believe it solves what >I perceive to be the problem. What we (or I) need is a simple, >elegant, extensible tool that is easy to learn and use. Do people >seriously claim that perl is it? If so, then perhaps it is time for >me to spend some time with my perl manual. Perl is a somewhat complex, somewhat kludgy tool which allows you to do (almost?) everything you can do in a Bourne shell script using sed, awk, test and expr. It is extensible in much the same way, by piping to or from other programs. It seems to me to have a good balance between simplicity and features, and between elegance and usefulness. The goal, after all, is to allow a system programmer to express the algorithms they need with a minimum of fuss. My first Perl script took me an afternoon of trying out versions with manual in hand. It involved taking a list of names in upper case, properly capitalizing them, and merging them into the gecos field of the password file. In this case, I might have been able to make an awk script in half the time, but next time I don't think Perl will be harder to write for. My feeling is that I will almost always be more sure of what a Perl script means than of the meaning of a shell script of similar complexity. A large part of this difference comes from the almost quoting-free regular expressions and the ``unifying'' of testing and control. And with the reputation of Larry Wall, I trust the core features of Perl to ``do what it means'' at least as much as I trust a 4.3BSD awk, for instance. So, elegant and simple: no. Simpler and easier to learn, write and maintain than sh, sed, awk, expr, test: yes, indeed. -- Lars Mathiesen, DIKU, U of Copenhagen, Denmark [uunet!]mcsun!diku!thorinn Institute of Datalogy -- we're scientists, not engineers. thorinn@diku.dk