#!/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; }