http://googlewhacks.blogspot.com/2008/02/perl_24.html
use Math::Combinatorics;
use utf8;
binmode(STDOUT, ":utf8");
my @balls = qw(ÀÄ ÀÖ ²« ÎÐ);
print "(1) 4¿§¤Î¥Ü¡¼¥ë¤ò½çÈÖ¤Ëʤ٤ë\n";
print join("\n", map { join " ", @$_ } permute(@balls));
print "\n";
print "(2) 4¿§¤«¤é2¿§Áª¤ó¤Ç½çÈÖ¤Ëʤ٤ë\n";
print join("\n", map { join " ", @$_ } (map { permute (@$_) } combine(2, @balls)));
print "\n";
print "(3) 4¿§¤«¤é2¿§Áª¤ÖÁȹ礻\n";
print join("\n", map { join " ", @$_ } combine(2, @balls));
print "\n";