Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^6: Simplify code in Perl with "unless" conditionnal

by Chaoui05 (Scribe)
on May 30, 2016 at 14:44 UTC ( [id://1164512]=note: print w/replies, xml ) Need Help??


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****

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1164512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found