Oct 1, 2017, 9:06 AM
They did not break backwards compatibility.
Re: [ningji] Do you plan to switch to perl 6 ?
While they do share the same root name and a number of other things, they are entirely different languages.
Was: $#array+1 or scalar(@array)Yuck, why would you use that "was" syntax? That is rarely ever coded that way or at least I should say is should not be coded that way. You don't show how you would actually use it, but here is the normal way to code that.
Similarly, your perl 5 (C style) for loop syntax is highly discouraged by most Perl coders. Instead you should be using Perl's for loop style.
Perl 6 should also support that style. In fact the documentation actually shows that style but puts the range in an array.
I have not tested perl 6 yet, but I plan on doing so soon. For the vast majority of the Perl coders, it's not a decision of whether or not to "switch"; it's a decision of whether or not to add another language to your repertoire.
(This post was edited by FishMonger on Oct 1, 2017, 9:23 AM)