sub combinations { return [] unless (@_); my @ret; while(@_) { my $card=shift(@_); push(@ret,[@$_,$card]) for(combinations(@_)) } return @ret; }