Perl 6 Perl 6 today #55

The cross (X) meta-operator

The X prefix can also be used on any infix operator to make it "cross":

my @suits  = < ♣ ♢ ♡ ♠ >;
my @ranks  = 2..10, < J Q K A >;

# concatenate each rank with each suit
my @deck = @ranks X~ @suits; 

say ~@deck;   # 2♣ 2♢ 2♡ 2♠ 3♣ 3♢ 3♡ 3♠ 4♣ ... A♢ A♡ A♠ 
Copyright © 2009
http://www.pmichaud.com/2009/pres/