#!/usr/bin/perl use strict; use warnings; my @allsuits = ( "clubs", "diamonds", "hearts", "spades" ); my @suitcards = ( "ace", 2 .. 10, "jack", "queen", "king" ); my $card; my @cards; my $suit; my @suit; my @suits; my @allfours; foreach $suit (@allsuits) { push( @suits, $suit ); @suit = $suit; print "$suit\n"; foreach $card (@suitcards) { push( @cards, "$card" ); } print "@cards[0 .. 12]"; push( @allfours, $cards[3] ); print "\n\n"; } print "All the fours of a suit - @allfours\n";