Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!mcsun!ukc!kl-cs!jonathan From: jonathan@cs.keele.ac.uk (Jonathan Knight) Newsgroups: alt.sources.d Subject: Cmail - the author responds Message-ID: <1125@kl-cs.UUCP> Date: 26 Oct 89 11:34:56 GMT Organization: University of Keele, England Lines: 44 Wow, I never thought that posting one little program would cause so much discussion. Anyway, here's my thoughts on all your talk. Perl may well be a reall hip language to write cmail in. Unfortunately the 20 unix machines we have here do not have Perl. However they ALL have a C compiler. I have no idea how fast perl is. If anyone wants to give a timing for the perl script on a 1800 line password file then I'll compare it to the C program. For now the best languages to write programs in if you want them to run on the largest number of unix machines is C or the Bourne shell and certainly NOT perl 3.0 which hasn't been posted yet. Someone suggested that the Bourne shell would be a good language. I felt that it would take too long to process a 1800 line password file using /bin/sh. If you think different then have a go. Someone also complained that I used getpwent() to read the password file which was inefficient. The reason for this was that some of the hosts around here run Yellow Pages and so I needed to make sure that cmail would run on those hosts. Getpwent() would work on all flavours of Unix at this site whether SYS V, BSD or BSD with yellow pages. So that was the easiest thing to use. Cmail takes 1.5 seconds to run on a password file of 1800 lines so I felt that it was acceptable. As a note to the perl and Bourne shell advocates, make sure you can use your version of cmail on hosts with yellow pages. I notice that the perl script that was posted does use getpwent and will be able to use yellow pages. The comparison of size of code isn't really fair. Firstly my code had comments. Secondly I wrote the code to be readable, not to be short. Thirdly the perl code doesn't cope with the various GECOS field styles. No doubt both programs could be shortened, but does it really matter? I can't read perl, so I can't compare the readability. Anyway, I like it as it is. -- ______ JANET :jonathan@uk.ac.keele.cs Jonathan Knight, / BITNET:jonathan%cs.kl.ac.uk@ukacrl Department of Computer Science / _ __ other :jonathan@cs.keele.ac.uk University of Keele, Keele, (_/ (_) / / UUCP :...!ukc!kl-cs!jonathan Staffordshire. ST5 5BG. U.K.