"(This is mostly just a skeleton with a few key URLs; feel free to flesh it out, improve the formatting etc.)"
Oh well, still a good starting place, I'll dig a little more
pugs> say "hello erf"
hello erf
bool::truepugs>
It may be simple, but its working perl 6 code.
my $square = -> $x { $x * $x }; # use "->" to introduce args
my @squares = map $square, 1.. 10;
I think, from reading the article futher that this means "taking
in" so the above example says $square is a function, taking in
$x, and the next line calls the square function using map, so
that @squares is full of the following sequence 1,4,9
It strikes me that you need to know perl5 to get into perl6 at
the moment - ineviatable I suppose, for the moment, but it may
hamper adoption by a lot of people who didn't like perl 5 and
didn't get into it for the very things that perl 6 fixes.
This probably isn't high on @*todo though...
Now its coming up to unicode operators, which is where pod on the
terminal fails abysmally. Control codes just aren't as readable as there true forms.
So falling back to the web, I try to find the original article,
in a nice format so that I can see which unicode chars they are
using. Casually flicking through the perl.com archives, I stumble
across this article:
http://www.perl.com/pub/a/2002/10/30/topic.html
Which is about topics, and includes a bit on the arrows above.
( -> doesn't require parentheses around its parameter list, and
it topicalizes its first parameter ). After about a third of
the way through it starts using a lot of perl 6 syntax that
doesn't look that familiar, so I think I need to come back to
this later.
+-------%< greeting.pl %<-----------------+
# Script to display hello world
"Hello World".say();
+-------%<-------------%<-----------------+
C:\perl6>pugs-win3 2\pugs.exe perl6code\greeting.pl
Hello World
C:\perl6>
Very Basic, but a start!
And next:
+-------%< squares.pl %<-----------------+
# Squares example
my $square = -> $x { $x * $x }; # use "->" to introduce args
my @squares = map $square, 1.. 10;
@squares.join("\n").say();
+-------%<-------------%<-----------------+
C:\perl6>pugs-win32\pugs.exe perl6code\squares.pl
1
4
9
16
25
36
49
64
81
100
C:\Documents and Settings\Administrator\My Documents\perl\perl6>
So far no nasty spikes to discourage me from going back, and from reading the articles it does appear to be a very powerfull, expresive language.
Perl 5 expertise not required (Score:1)
What makes you say that? Anyone with knowledge of Smalltalk or Ruby or Lisp or the like (basically anything that has lists and closures) should be immediately familiar. In fact, they’ll have an easier time getting into the Perl 6 version, where you can specify a parameter, than the Perl 5 version, where you have to monkey with this bizarre $_ thing.
Conext of remark screwy (Score:1)