# Change 'from' to 'to' throughout 2D-array sub propogate { my($arry) = shift; my($from) = shift; my($to) = shift; my($row); map { map { $_ = $to if($_ == $from); } @{$_}; } @{$arry}; };