my @bin2 = (0) x 15; # assign 15 zeros @bin2[@pos] = (1) x @pos; # fill in the 1's