in reply to sequence of positions to binary sequence
my @arr = (2,4,9); my @rslt; $rslt[$_]=1 for @arr; $_ or ($_ = 0) for @rslt; print "@rslt"; #0 0 1 0 1 0 0 0 0 1 [download]