in reply to Re^6: Simplify code in Perl with "unless" conditionnal
in thread Simplify code in Perl with "unless" condition
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use List::Util qw{ shuffle }; my @browsers = ('firefox', 'chrome', 'internet explorer'); my %screen = map { $_ => "$_\'s screen" } @browsers; my @random_array = shuffle(@browsers); for my $b1_idx (0 .. $#random_array - 1) { my $b1 = $screen{ $random_array[$b1_idx] }; for my $b2_idx ($b1_idx + 1 .. $#random_array) { my $b2 = $screen{ $random_array[$b2_idx] }; say "About to compare $b1 with $b2"; } }
About to compare firefox's screen with chrome's screen About to compare firefox's screen with internet explorer's screen About to compare chrome's screen with internet explorer's screen --- About to compare chrome's screen with internet explorer's screen About to compare chrome's screen with firefox's screen About to compare internet explorer's screen with firefox's screen --- About to compare internet explorer's screen with firefox's screen About to compare internet explorer's screen with chrome's screen About to compare firefox's screen with chrome's screen
($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,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Simplify code in Perl with "unless" conditionnal
by Chaoui05 (Scribe) on May 30, 2016 at 13:50 UTC | |
|
Re^8: Simplify code in Perl with "unless" conditionnal
by Chaoui05 (Scribe) on May 30, 2016 at 13:56 UTC | |
by choroba (Cardinal) on May 30, 2016 at 14:00 UTC | |
by Chaoui05 (Scribe) on May 30, 2016 at 14:47 UTC |