|XP is just a number|
Perldoc, the tutorialby Juerd (Abbot)
|on Jun 01, 2002 at 23:26 UTC||Need Help??|
Most people learn Perl by reading a simple tutorial, which probably, as they find out later, resembles all sorts of wrong. Some are lucky and find a good tutorial. Other people begin by reading books. There are terrible books and there are good books. However, books are a slow way of learning a language, in my opinion, and they cost money. Good learning books are read only once (if you read your learning book twice, it didn't do a good job at teaching you, did it?). I tend to avoid buying books.
How did I learn Perl then? First, let me explain why I wanted to learn Perl. As a Basic programmer, having used many Basic dialects, I found that there was no statisfying Basic interpreter for Linux, but I did want to use this new and exciting operating system. So I went looking for other languages. Of course, I first considered C, but I have always disliked C and even the thrill of having another platform couldn't get me to like this powerful language. Perl was the next language I looked at. To a Basic programmer, all the cryptic characters look strange, but its string interpolation and hashes were quite convincing to me. I learned Perl and do not feel any need to learn other languages anymore.
When learning how to use Linux, fortunately someone told me to use man whenever I needed help. I wanted to know more about Perl, so I typed man perl. It refered to a bunch of other documents, that I read almost sequentially, skipping those that didn't intrigue me. I learned a great deal of both English and Perl reading the perldocs. There is a lot of information there, and to beginners, it isn't always clear where some things can be found. The terminology was never explained, but I learned to recognise words by ignoring the fact that I had no idea what they were talking about.
A few years later, I still think reading perldocs is the best way of learning Perl. That said, I would like to complain about some things. I now know why strict should be used where possible, and that -w can be very helpful too. This is because people told me, not because I read about it. I think the use of these should be encouraged more by the Perl documentation. The other complaint I have is that some things just aren't explained well enough to beginners. Basic didn't teach me anything about scoping, so I had some trouble with that.
This brings me on the subject of tutorials in perldocs. There are some great extensive but comprehensible tutorials, like perlreftut and perlretut, and some tutorials that are not really easy like perldebtut and perltoot. The most important tutorial can not be found in the standard distribution. perltut it should be called. I don't know if there exists a tutorial that we all agree is clearly the best Perl quick start tutorial there is. But if such a tutorial, it should be distributed with Perl. If there is not, it should be created.
You might wonder why perltut is needed. For the greatest part, it's just because without it, the perldocs are incomplete: they cover everything except for the learning Perl part. But there's another reason: it is now very unclear if there is a tutorial that is accepted by the community, and having perltut would fix that, as we have to agree perldocs are generally quite good.
Not everyone wants to learn a language by reading much documentation, like I did (although I do think it's the best way). Many want a tutorial. I think that tutorial should come with perl itself.