@bin[@pos] = (1) x @pos; #(undef, undef, 1, undef, 1, undef, 1, undef, undef, 1) #### $_ ||= 0 for @bin; #(0, 0, 1, 0, 1, 0, 1, 0, 0, 1) #### my @bin2 = (0) x 15; # assign 15 zeros @bin2[@pos] = (1) x @pos; # fill in the 1's
## $_ ||= 0 for @bin; #(0, 0, 1, 0, 1, 0, 1, 0, 0, 1) ##
## my @bin2 = (0) x 15; # assign 15 zeros @bin2[@pos] = (1) x @pos; # fill in the 1's