in reply to Copying two-dimensional arrays

Welcome to the Monastery! You have nice puzzle, where I think I would use a different approach. Basically, when a user comes up with a starting grid coordinate, and a word to insert (horizontally or vertically) at that point, all you want to do really is to determine the length of the user's proposed word, and do two things:
# Assume this is a subroutine, called with these args: my ($grid_size); # number of rows, columns (square grid, right?) my ($bgnX,$bgnY); # user's start coords; my ($new_word); # user's proposed word; my ($direction); # down or across my $newlen = length( $new_word ); if ( $direction eq 'down' ) { if ( $bgnY + $newlen > $grid_size ) { return "$new_word doesn't fit going down from $bgnY\n"; } my $ongrid = ""; for ($bgnY .. $grid_size-1) { $ongrid .= $board[$bgnX][$_]; } return "$new_word doen't match existing tiles\n" unless ( $new_word =~ /^$ongrid$/ ); } else { # left as an exercise... }