>perl -wMstrict -le "use Data::Dump; ;; my @resultarray = (0, 0, 0, 0, 0, 0); dd \@resultarray; ;; $resultarray[3] =~ s/^0$/1/; dd \@resultarray; " [0, 0, 0, 0, 0, 0] [0, 0, 0, 1, 0, 0]