in reply to Simplify code in Perl with "unless" condition
You can use loops to iterate over the browsers, though, and you can use variables to avoid fetching the hash values every time:
my @browsers = ('firefox', 'chrome', 'internet explorer'); for my $b1_idx (0 .. $#browsers - 1) { my $b1 = $screen{ $browsers[$b1_idx] }; for my $b2_idx ($b1_idx + 1 .. $#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 for de +tails\n"; qx{ $diff_file }; } } }
Update: missing +1 added.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|