in reply to Re^3: Simplify code in Perl with "unless" conditionnal
in thread Simplify code in Perl with "unless" condition
my @browsers = ('firefox', 'chrome', 'internet explorer'); my @random_array = shuffle(@browsers); for my $b1_idx (0 .. $#random_array - 1) { my $b1 = $screen{ $browsers[$b1_idx] }; for my $b2_idx ($b1_idx .. $#browsers) { my $b2 = $screen{ $browsers[$b2_idx] }; unless ($b1->compare($b2)) { my $diff_file = $b1->difference($b2); print '#The images are not the same; see' . $diff_file .' fo +r details'."\n"; qx{ $diff_file }; } } }
Doing that, my goal is to get a random element from list :
my @browsers = ('firefox', 'chrome', 'internet explorer');
For example, compare at first 'chrome' screenshot with 'internet explorer' screenshot and after 'firefox' with 'chrome' etc.
Thanks
|
|---|