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

Thanks for the reply, it's cool.

First i want to do a randomize comparison test in the objective to not have same difference' screenshot at each time. And moreover to have different filename. Thanks for your approach , but it seems that we have always first browser with following and the following with following as we can see in your output ? And i would like to get them randomly for my part.

Yes , in any case, here i have enough information. Thanks

Concerning the way to post , i always try to explain the case with the maximum of information i.e. with the input and maximum of code as it's possible and with the output. And of course with explanations. iam using posts edited here, in perlmonks.

Thanks again !

Lost in translation
  • Comment on Re^6: Simplify code in Perl with "unless" conditionnal

Replies are listed 'Best First'.
Re^7: Simplify code in Perl with "unless" conditionnal
by haukex (Archbishop) on May 30, 2016 at 17:12 UTC

    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

      Thanks , it seems even more better
      *****Lost in translation****TIMTOWTOI****