in reply to Re^4: Simplify code in Perl with "unless" conditionnal
in thread Simplify code in Perl with "unless" condition
Hi Chaoui05,
From experience I can tell you that it's not always a good idea to randomize tests (it causes random failures and random successes, different on each run, not easily reproducible), instead making them deterministic. Why do you want to pick random browsers to compare?
This compares each browser to each other browser:
use Algorithm::Combinatorics 'combinations'; my @browsers = ('firefox', 'chrome', 'internet explorer'); my $iter = combinations(\@browsers,2); while (my $c = $iter->next) { print "Compare $$c[0] with $$c[1]\n"; } __END__ Compare firefox with chrome Compare firefox with internet explorer Compare chrome with internet explorer
I never know if i give enough information or not at each time.
As a basis you can always do the same thing: post short but runnable code that reproduces the problem along with short sample input, the output you would expect from that code (written by hand if necessary), and the output you're actually getting, including exact error messages. This is explained, for example, in How do I post a question effectively? and Short, Self Contained, Correct Example. If you're unsure, ask yourself, what information do we need to easily reproduce the problem you are seeing?
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Simplify code in Perl with "unless" conditionnal
by Chaoui05 (Scribe) on May 30, 2016 at 14:44 UTC | |
by haukex (Archbishop) on May 30, 2016 at 17:12 UTC | |
by Chaoui05 (Scribe) on May 31, 2016 at 07:24 UTC |