canspice.org

home about code feeds archives links

OSCON 2007: Perl 6 Update, by Larry Wall

The most recent in a long string of Perl 6 update presentations, Larry Wall talked about some of the new features of Perl 6. Usually he teams with Damian Conway, but unfortunately he’s not here this year.

Last year there were 207 separate patches to spec, this year there were 412. We’re in the final 20% of the 80/20 rule (80% of the project takes 80% of the time, the other 20% takes 80% of the time).

Class and module names can now have adverbial modifiers, so you can supply versioning information when you’re using or writing classes:

use Codex:author<cpan:LDAVINCI>:ver<2.0.1>;

Inline comments are now in:

$this = $code && #{this is a comment} $code2;

There’s no more defaulting to $_.

You can zip arrays together:

my %hash = @keys Z @values;

File test operators are gone, replaced with:

if $file ~~ :r { say ‘Can read’ };
my $size = $file ~~ :s;
my $size = $file.:s;

There is an explicit parallelism operator:

%hash = hyper map { $_, value($_) }, @array;

STM is implemented:

contend {
maybe { foo() }
maybe { bar() }
maybe { defer if $oops }
}

You can create a fixed-size array, and Perl will crash exceptionally if you try to access outside of the bounds:

@calendar[12];
my @spacetime[100;100;100;**];

Negative indices no longer count backwards from the end. You have to use the ‘whatever’ operator for that:

$array[*-N];

POD has been cleaned up and extended.

Also see Chris’s coverage.

Tags: , , , , ,

Leave a Reply

Name (required)
Mail (required)
Website
Comments