There's a lot of repitition there as you can doubtless see. This suggests a loop. Here's an outline:
#!/usr/bin/env perl use strict; use warnings; my @things = qw/firefox chrome exploder/; while (my $this = shift @things) { for my $that (@things) { print "Now compare $this with $that\n"; } last if $#things < 1; }
You can obviously replace the print statement with whatever block you require for each permutation of entries in @things. HTH.
In reply to Re: Simplify code in Perl with "unless" loop
by hippo
in thread Simplify code in Perl with "unless" condition
by Chaoui05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |