CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: General Discussions: General Questions: Re: [ningji] Do you plan to switch to perl 6 ?: Edit Log



FishMonger
Veteran / Moderator

Oct 1, 2017, 9:06 AM


Views: 5351
Re: [ningji] Do you plan to switch to perl 6 ?

They did not break backwards compatibility.

While they do share the same root name and a number of other things, they are entirely different languages.


Quote
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.

Code
my $cnt = @array;


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.

Code
for (0..9) { ... }

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)


Edit Log:
Post edited by FishMonger (Veteran) on Oct 1, 2017, 9:22 AM
Post edited by FishMonger (Veteran) on Oct 1, 2017, 9:23 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives