#! perl use strict; use warnings; use Math::Combinatorics; my @n = qw(a e i o u); my $com = Math::Combinatorics->new ( count => 2, data => [@n], ); my $s = join(' ', @n); print '-' x (24 + length $s), "\n"; print "Combinations of 2 from: $s\n"; print '-' x (24 + length $s), "\n"; while (my @combo = $com->next_combination) { print join(' ', @combo), "\n"; }