This is a brief summary of my notes from the Perl 6 and pugs sessions. I have only included the stuff that was new compared to the Perl 6 Appendix in the 'Perl Programming' course. I might have repeated myself.
use strict and use warnings are on by default;
Quotes are only required around a hash key when {} are used.
$hash{'key'} becomes %hash
Barewords are not allowed. Ever. Even for file handles.
fail{…} warn{…} die{…} throw a 'not yet implemented' type warning – the Perl 6 developers must be using that a lot ;-)
Many improvements to interpolation:
"{ executable code like a do block} "
Subroutine calls are allowed: "&mysub(args)"
Interpolate an array: "@array[]"
Interpolate a hash: "%hash{}"
sprintf is probably obsolete, printf definitely is:
print $var.as('%6.2f');
print $hash.as("%-20s: %2.6f", "\n");
Control can be made over exactly what is interpolated:
qq:c(0)/ / # don't interpolate
qq:s(1)/ / # only interpolate scalars
qq:s(1):a(1)/ / # interpolate scalars and arrays
hummmmmmm
Here document syntax is changed:
my $var = q:to /END/ # s(1):a(1):h(1) can be added
…
END
Not sure where the semi-colon goes
Ranges have a new feature:
x..^y means from x up to y-1
x^..^y means from x+1 to y-1
To open a file with an automatic chomp::
my $fh = open $filename
This can be overridden.
while (<$fh>) {…}
becomes:
while = $fh {…}
while (<>){…}
becomes
while = $ARGS{…} or while =<> {…}
=<> is known as the 'fish' operator
There is now a 'prompt' verb
Most built-ins that operator on scalars and arrays are now methods:
$var.substr(…) # returns the substring
$var .= $var.substr(…) # changes the substring
No need for Data::Dumper, instead:
$var.perl()
And there is much more, Damian could not complete his talk because of time, and it is not downloadable. I'll keep you posted as I play with pugs.