in reply to What I am missing here
I think your shuffle is buggy. Use the built in shuffle instead.
use List::Util; # ... snip ... @deck = List::Util::shuffle @deck;
In Section
Seekers of Perl Wisdom