Learning Perl - the Good and the Bad (Tutorials, Habits, and Tools, etc)



I've been learning Perl in my spare time for the past week or so. I
have had experience with dynamic languages before, so my perspective
may not be typical. Without too much effort and frustration I'm at the
stage where I feel I've got the rhythm of the language and progress on
to do anything I want in it - in particular variable context isn't
causing me a problem anymore and I cab build any damn data structure I
want using references.

It has been my experience in the past that once you know a language
well it is almost impossible to understand the issues that gave you
problems while learning, so I thought I'd make some notes now in case
they were helpful to other people learning the language.

Overall
=====
Learning Perl is somewhat more difficult than learning, say, Python,
but not as much more as you might think at the beginning - especially
if you do things right (see The Good below). Context and references
will give you more trouble than anything else, but they context is
definitely a feature you will appreciate when it clicks (well, it was
for me) and explicit control of reference vs value is a very nice
feature to have. Perl's parameter passing seems (very) primitive at
first, but it's powerful and you soon learn to live with it.

Compared, again, to Python, I'm finding that although Perl was harder
to learn as a language, I need to remember many fewer library functions
to get work done. Overall, I'd call this a win.

Probably the biggest feature of Perl as implemented that I'm less happy
with is that it uses reference counting for memory management - I
believe this will change with Parrot (so possibly by the end of this
year?) and that I haven't found an equivalent of Python's "Pickle" yet
for easy persistence.


The Good
=======
* There are several visual debuggers available for Perl. I'd get one
and use it right from the start (unless you are an Emacs and gdb
fiend).

* ActiveState's Komodo is a superb tool. The Personal Edition is free
for a month and then $30. It includes not just a terrific debugger but
a syntax aware editor that identifies and *explains* a lot of errors as
you type. If Komodo runs on one of the OS's you are willing to use then
I'd suggest downloading it at the same time you download Perl. I really
feel that using Komodo may literally halve the difficulty and time in
learning Perl compared to using a conventional editor and no debugger.

* "Roberts Perl Tutorial" and especially "Perl in 20 Pages" are both
excellent tutorials.

* "Teach Yourself Perl In 24 Hours" by Clinton Pierce is editted by the
legendary Scott "Effective C++" Meyers - to C++ programmers, enough
said.

* The standard Perl docs are excellent. In particular make sure you
read Perlreftut (about references) and Perlrequick (regular
expressions). (The one negative thing I'd say about ActiveState is that
their layout of their docs rather buries the original table of contents
that supplemented these gibberish names with meaningful descriptions.)

* Lots of excellent quality articles, eg on Perl.com. Anything by
Conway, Dominus, or Cozens will be worth reading.

* Perl.Beginners.

The Bad
======
* "Learning Perl" aka The Llama book. It doesn't work. An introductory
book Perl book that doesn't explain references is like a C book that
doesn't that explain pointers - the reader could program after a
fashion - badly. I don't see how someone who has read Llama and nothing
else could write a useful function to add two arrays. Worse, the Llama
doesn't explain that you are missing a key piece of the puzzle, and by
the time you discover references you may completely have to break a
model of Perl programming that has solidified in your mind. If the
Llama book warned you - at the start and on at least the back cover -
that it was missing a treatment of an essential topic, I might say fair
enough - but the book is being sold as an adequate introduction to Perl
for professional programmers and it is NOT. This might have been
tolerable when Perl was introduced, but there are better books (and
free net tutorials) available now, and I think the problems the Llama
creates are disadvantaging Perl compared to Python and Ruby, as well as
creating needless difficulties for people who read the book.

.



Relevant Pages

  • Re: END-IF
    ... > most-used language. ... The measurement was not of usage but was entirely of references to it. ... In particular I noted the disparity between Perl and Python. ...
    (comp.lang.cobol)
  • Re: Learning Perl books
    ... inexperienced programmer wishing to use Perl on a Windows platform? ... Learning Perl book, ... Both are excellent books for learning the Perl programming language. ... it doesn't deal sufficiently with command line ...
    (perl.beginners)
  • Re: free source bbs
    ... > MB> IIRC, it was 'Learning Perl' the pink covered book, from about ... Programming Perl - the ampersands for sub calls just stuck over the ...
    (comp.lang.perl.misc)
  • Re: Roaming profile in problem
    ... Perl can be learned USEFULLY in stages. ... The two class books are "Learning Perl" (14.75 ... "Programming Perl" is MUCH better and an eventual ... Herb Martin> ...
    (microsoft.public.win2000.active_directory)
  • Re: OT: Should I learn bash/C/python/perl/other
    ... >> perl. ... which might not be the case for an old python ... > from a language that forced me to rewrite my code when I update. ... at work gave me a book called Learning Perl. ...
    (Fedora)