in reply to Re^4: Changing the numerical value from 0 to 1
in thread Changing the numerical value from 0 to 1

... how do I substitute the $resultarray[3] values from 0 to 1 instead of doing at @resultarray?

One way:

>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]