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.
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.
Most of the modules for Perl 6 are currently just reimplementations of Perl 5 modules.
Perl 5 isn't going to go away.
Most of the current versions of the Perl 5 language have come out after work on the Perl 6 specification started.
Arguably Perl 6 saved Perl 5.
There are also a few reasons for recommending Perl 6 over Perl 5.
It has been redesigned so that different things look different, and similar things look similar, to a much greater extent.
Parallelism has been designed into the language
Many arguably conflicting paradigms have been combined in a way that feels as if they were just some part of a whole.
Nicer default object system ( Moose/Moo/etc in Perl 5 is great too, and have been copied to other languages )
There are fewer special cases.
There are more ways to express your ideas, which allows you to choose one that is easier to read.
Meta operators
Normal operators are just subroutines, which allows you to add new ones, and extend existing ones. ( don't use existing operators for things they weren't designed for, add new ones )
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.
发布评论
评论(5)
如果您想要 CPAN,则使用 Perl 5;如果您想要可接受的运行时性能,则使用 Perl 5;如果您想要稳定性和完整的语言,则使用 Perl 5。如果您想玩世界上最漂亮的玩具,请选择 Perl 6。
当然,它们并非互不兼容——我编写 Perl 5 是为了报酬和大部分“严肃”的开源工作,而编写 Perl 6 是为了乐趣。但我编写 Perl 的时间已经足够长了,以至于我对 Perl 5 已经很适应,所以我可以在业余时间转换方向并编写 Perl 6。
但对于刚刚起步的人来说,您当然只想专注于一种语言,并且出于最实际的目的,该语言应该是 Perl 5。无论 Perl 6 取得多大成功,Perl 5 在未来 10 年内不会随时消亡,尽管 Perl 5 和 Perl 6 是完全不同的语言,但您仍然可以学到很多东西如果您将来选择学习 Perl 5,《Perl 5》将帮助您开始使用 Perl 6。
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 网页 的引用(重点是我的):
Perl5已经成熟了。 Perl6 正在开发中。
Here is a quote from the Perl6 webpage (emphasis is mine):
Perl5 is mature. Perl6 is in development.
Perl5。
如果您愿意进行全新的开发并且可以等待 N 年直到 Perl 6 真正问世,您可以学习 Perl 6。但实际上,Perl5。
编辑澄清:Rakudo Star,a
最近引起了一些关注,但它还不是完整的或最终的,并且还没有真正准备好在生产环境中部署。如果您在未来一三年内寻找新工作,它不太可能帮助您获得那份工作。也许最重要的是,如果企业对 Perl 6 感兴趣,那么它很可能也有一些 Perl 5 基础设施,并且在学习之前先学习 Perl 5 及其局限性,您会更好地准备理解它一种明显较新的语言,如 Perl 6。
如果您只是寻找“乐趣”,您可能确实更喜欢 Perl 6...或者您可能更喜欢更可用的 Perl 5 及其通过 CPAN 提供的各种预打包模块。
Perl 6 没有发布日期。
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
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.
建议先学习 Perl 5 再学习 Perl 6 有几个原因。
Perl 6 仍在设计过程中。这意味着您现在学到的一些东西以后可能不再适用。推荐 Perl 6 而不是 Perl 5 还有一些原因。
(Perl 5 中的 Moose/Moo/etc 也很棒,并且已被复制到其他语言)
(不要将现有的运算符用于其设计目的之外的用途,添加新的运算符)
There are several reasons for recommending learning Perl 5 before learning Perl 6.
Perl 6 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 also a few reasons for recommending Perl 6 over Perl 5.
( Moose/Moo/etc in Perl 5 is great too, and have been copied to other languages )
( don't use existing operators for things they weren't designed for, add new ones )
Perl5 仍然建议用于生产代码,并且拥有庞大的支持社区,不过,作为 Perl6 的证明,如果您遇到问题,则更有可能是该语言的新增内容,而不是 Perl5 中的那些问题。
一旦 Perl6“发布”,Larry Wall 和其他人就创建了一个翻译器,它将把大多数(如果不是全部)Perl5 代码转换为 Perl6 语法,如果这对您的决定有帮助的话。
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.