Perl 6 Perl 6 today #20

Creating lists

In Perl 6, <...> takes the place of Perl 5's qw()

Each of the following do the same thing:

@suits = ('Clubs', 'Diamonds', 'Hearts', 'Spades');

@suits = qw { Clubs Diamonds Hearts Spades };

@suits = < Clubs Diamonds Hearts Spades >;

We can also use angles for initializing hashes

%scores = < pmichaud 52   mäsak 95   PerlJam 78 >;
Copyright © 2009
http://www.pmichaud.com/2009/pres/