use strict; use warnings; my @cards; for my $suit (qw(_clb _dmd _hrt _spd)) { for my $rank (2 .. 10, qw(j q k a)) { push @cards, $rank . $suit; } } for (1 .. 10) { my $index = int rand scalar @cards; print splice(@cards, $index, 1), "\n"; }