[Malvern] Perl.

chris at yordas.demon.co.uk chris at yordas.demon.co.uk
Thu May 6 12:08:01 BST 2004


geoff.bagley at btinternet.com wrote:
> This is really in response the Chris's interesting mail.
> 
> I understand that Perl is normally "interpreted", as opposed to compiled.

Perl is odd, it's kind of just-in-time compiled.  You can link other languages
into it too which can make very time-critical stuff possible but just using
the Perl to glue it together.

> I have little experience of interpreters,  confined to  BASIC  :-(   and a
> little time spent plating with FORTH.  All my programming has been in 
> Algol 60, FORTRAN 4, Algol 68, Z-80 assembler,  and Turbo Pascal 7.0.
> 
> The last one is my work-horse,  and although C is very attractive from a
> "compatibility" point of view, I am not convinved that whole-sale conversion
> from Pascal will have great advantages for me.

Yes, you can link things together but say you're looking for an example of
how to connect a client to some server with a mysql database, you're much more
likely to find code you can crib directly in C, Perl etc. than in Pascal.  In 
Pascal you'd probably have to cross code an example from C then work out for 
yourself why it wasn't working, whether it's your Pascal or your understanding
of the C.  I used to write Pascal at uni and wasn't keen to learn C but it 
became pretty clear I could be much more productive in C.

> If you use the GNU C and gpc cpmpilers, you can mix them.

This is true but that wasn't really my point.

> Perl though, I think is both interpreted AND  structured/object oriented.
> That would be new for me.

You don't have to use the features you don't want.  I tend to write C-style code
and compile it as C++ because I like the stricter type checking and it gives
me fewer errors in the end.  I've only really used Perl's object oriented 
features with the Tk GUI and that was easy peasy.

> I would worry about "scope" for example. Would the OOP RECORDS/OBJECTS etc.
> be global ?

You can have things pretty much however you want them.

> How many of you use Perl a lot ?

I'm far from being a serious Perl coder but it is useful to know.

> Chris -  did you say that your moving map + GPS program you
> showed us used Perl ?

That was Tcl with the Tk toolkit for the display.  I've written a Perl/Tk 
version too but that wasn't on the Libretto.

Cheers

Chris





More information about the Malvern mailing list