Why Learn Perl
This page is an answer to a class of common questions on Freenode's #perl:
- Should I learn Perl at all?
- Should I learn Perl as well as Python/Ruby/PHP/whatever?
- Is Perl "better" than PHP (or whatever)?
- Which programming language should I learn first?
There aren't black-and-white answers to these questions, and if you ask N programmers you'll receive N+1 (or more) answers. so these are our attempts at answering them.
How serious are you about programming?
There are several types of programmers, including but not limited to:
- Professionals who do this for a living.
- People who are not programmers by profession, but have learned it to accomplish certain ends. For instance: system administrators, bioinformaticians, computational linguists, engineers who design things using a computer, etc.
- Full-fledged software enthusiasts (known as hackers - not necessarily computer intruders!) who love programming or are eager to learn it, and/or find it an enjoying pastime.
- People for which programming is an after-hours hobby, but don't want to invest too much time in it.
Some reasons why you should consider learning Perl include:
- It's highly eye-opening and enlightening.
- It's very useful, and CPAN makes it much more so.
- It's very common and you'll probably need to understand the Perl code of other people (including to learn from it and to criticise it.).
- It's very fun and has a rich culture and community.
(Perl has its share of technological and community problems, of course, but that's beside the point.)
Many people are forced to learn or use Perl because that's what their peers or organisation are using. Furthermore, if you don't know Perl, you are probably lacking essential programming education, just as someone who doesn't know basic Algebra or basic geography is lacking essential general education.
Which Programming Language Should I Learn First?
No-one seems to agree about it. Shlomi Fish has written an entire essay about it where he links and summarises several approaches (and criticises them). Fish's ultimate conclusion is that either Perl, Python or Ruby are the best languages for that, and that all things considered Perl is probably the best at this point. Other people naturally disagree for reasons of their own.
In any case, if you're serious about becoming a good programmer, you should learn Perl at a point. There are too many programmers who only know Java or PHP or Visual Basic or COBOL (%-)) or C/C++ or whatever, and while they can be productive and write good solid code, they still lack the essential perspective from knowing many different languages and environments.
Note that knowing Perl exclusively is not such a good idea either in the long-run. By all means you should learn such languages as C, Python, Scheme/Lisp, Haskell, Assembly, C++ and Java and/or .NET. But Perl 5 is still very important to learn.