in reply to Re^6: Simplify code in Perl with "unless" conditionnal
in thread Simplify code in Perl with "unless" condition

Hi Chaoui05,

Well, to randomize it, you can shuffle both the list of browsers and the list of combinations, that'll ensure that you always have all comparisons but in a random order:

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

Hope this helps,
-- Hauke D

Replies are listed 'Best First'.
Re^8: Simplify code in Perl with "unless" conditionnal
by Chaoui05 (Scribe) on May 31, 2016 at 07:24 UTC
    Thanks , it seems even more better
    *****Lost in translation****TIMTOWTOI****