in reply to Random distribution

I'd use the List::Util module to randomize the input, then drop the randomized letters in place.
use List::Util qw(shuffle); my @letters = shuffle(A .. Z); print @letters; # prints something like WOGJLMXQCDVIPNESURZHTFYKBA for $r (1 .. 2) { # or whatever size you need for $c (1 .. 13) { # same here $data[$r][$c] = shift @letters; } }