use List::Util 'shuffle'; use Algorithm::Combinatorics 'combinations'; my @browsers = shuffle('firefox', 'chrome', 'internet explorer'); for my $c (shuffle combinations(\@browsers,2)) { print "Compare $$c[0] with $$c[1]\n"; } __END__ Compare internet explorer with firefox Compare firefox with chrome Compare internet explorer with chrome