|
|
|
|
|
by user9756
3859 days ago
|
|
Great (basic) introduction with exception to the regex chapter because it felt like an introduction to regex instead of the regex features of perl6. Some things I found interesting (in addition to what s_kilk mentioned and linked to and others have already mentioned some of them)
* Gradual typed!
* Multi subroutine
* Hyphen in variable names
* @numbers.=sort
* .WHAT
* Catch blocks
* .defined
* Unless It will be fun :) I however don't understand the reason for the naming of eg elsif, my, slurp/spurt?? (instead of else if or local or fread/fwrite) Is it a perl culture thing? Because they mention in the tutorial that Perl 6 belongs to the C-family languages (and then call the "for" loop in C "loop"). |
|
my is Perl 5, is different than local, and is gloriously short. Nicest way I've ever seen to declare a variable. :)
slurp/spurt are routines to read/write an entire file at once. slurp is pretty standard in other languages, I believe, and spurt was chosen to be a natural opposite to it. Perl 6 still has open / close / read / write, etc. Though to be fair, honestly I usually use lines, which (with no other arguments) gives you a lazy list of the lines in standard input / files specified on the command line.
for in Perl 5 was some weird combo which could be iterating over an array or a C-style for. In Perl 6, those have been separated. Because iterating over an array is vastly more common, that gets the shorter keyword. The C-style loop got the loop keyword.