Cmail - the author responds

Jonathan Knight jonathan at cs.keele.ac.uk
Thu Oct 26 21:34:56 AEST 1989


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 at uk.ac.keele.cs     Jonathan Knight,
    /       BITNET:jonathan%cs.kl.ac.uk at ukacrl Department of Computer Science
   / _   __ other :jonathan at cs.keele.ac.uk     University of Keele, Keele,
(_/ (_) / / UUCP  :...!ukc!kl-cs!jonathan      Staffordshire.  ST5 5BG.  U.K.



More information about the Alt.sources.d mailing list