I've been thinking about learning Perl. Should I learn Perl5 or start with Perl6?
Perl5.
If you're willing to do all-new development and can wait N years until Perl 6 is actually out, you can learn Perl 6. But really, Perl5.
edit to clarify: Rakudo Star, a
useful, usable, "early adopter" distribution of Perl 6
has recently garnered some attention, but it's not complete or final, and it's not really ready for deployment in a production environment. If you're looking for a new job in the next year or three, it's unlikely to help you get that job. Perhaps most importantly, if an enterprise is interested in Perl 6, chances are it's got some Perl 5 infrastructure too, and you would be better prepared to understand it by learning Perl 5 and its limitations first before you learn a significantly newer language like Perl 6.
If you're just looking for "fun" you may indeed prefer Perl 6... or you may prefer the much more available Perl 5 and its wide variety of prepackaged modules available via CPAN.
There is no release date for Perl 6.
Here is a quote from the Perl6 webpage (emphasis is mine):
Perl 5 and Perl 6 are two languages in the Perl family, but of different lineages. If you are looking for production ready code please use Perl 5.
Perl5 is mature. Perl6 is in development.
Perl 5 if you want CPAN, Perl 5 if you want acceptable runtime performance, Perl 5 if you want stability and a language that's complete. Perl 6 if you want to play with the world's niftiest toy.
Of course, they're not mutually incompatible -- I write Perl 5 for pay and for most of my "serious" open-source work, and Perl 6 for fun. But I've been writing Perl for long enough that I'm comfortable enough with Perl 5 to switch gears and write Perl 6 in my spare time.
But for someone just starting out, of course you want to focus on just one language, and that language should be Perl 5 for most practical purposes. Perl 5 is not going to die anytime in the next 10 years, no matter how much success Perl 6 enjoys, and even though Perl 5 and Perl 6 are definitively different languages, still a lot of what you learn from Perl 5 will help you get started with Perl 6 if you choose to learn it in the future.
Perl6 has been in development since July 2000. You decide if you want to wait on it.
Perl5 is still suggested for production code and has a large support community, though, as a testament to Perl6, if you encounter problems, it is more likely to be from new additions to the language, not those things that were in Perl5.
Once Perl6 is "released", Larry Wall and others have created a translator, which will convert most (if not all) the Perl5 code into Perl6 syntax, if that helps in your decision.
I would recommend learning Perl5 before learning Perl6, for several reasons.
- There are more books on writing Perl5 programs than Perl6 programs.
- There is just more information for programming in Perl5 than for programming Perl6.
- Perl6 is still in the process of being designed. Which means that some of the things you would learn now, might not be applicable later.
- There are many quality Perl5 modules, while there are only a relatively small number of Perl6 modules.
- CPAN
- Most of the modules for Perl6 are currently just reimplementations of Perl5 modules.
- Perl5 isn't going to go away.
- Most of the current versions of the Perl5 language have come out after work on the Perl6 specification started.
- Arguably Perl6 saved Perl5.