sub cleararray() { my $class = shift; for ($i=0;$i<$radiovar;$i++) #reset array to empty { for ($j=0;$j<$radiovar;$j++) { $array[$i][$j]="0"; } } }