#!/usr/bin/perl -w use strict; my @deck; foreach my $suit qw(clubs diamonds hearts spades) { #print "Working on the $suit\n"; # un-comment to watch looping foreach my $card_type (2..10,'ace','king','queen','jack') { #print " Now card=$card_type\n"; # un-comment to watch loop push @deck, "$card_type of $suit"; } } print "There are ".@deck." cards in the deck\n"; foreach my $card (@deck) { print "$card\n"; } __END__ Output....uncomment the 2 print statements in the nested loop to see exactly how the looping is done... There are 52 cards in the deck 2 of clubs 3 of clubs 4 of clubs ... etc. then diamonds, then hearts, spades...