use strict; use warnings; use List::Util qw(shuffle min max); use Data::Dumper; my @cards; foreach my $r (2..10,'J','Q','K','A') { foreach my $s (qw(H S D C)) { push @cards,"$r$s"; } } my @deck = shuffle @cards; my @hand = sort @deck[0..4]; @hand = @ARGV if @ARGV; print join(", ",@hand) . ": "; # your solution here, put answer in $hand # end print $hand;