use strict; use warnings; my @array=qw/a b c d/; while( my $first = shift @array ) { print "$first-$_\n" for @array; }