To help us help you better, please show what code you've already written and how it fails to achieve your goal. Also, it helps if you describe to us in plain English what approach you try to create the "binary array".
A simple approach to a solution would be to recognize that the "binary array" contains only zeroes except at the places given in @pos. As Perl doesn't conveniently handle infinite lists in most places, you have to find an upper bound for the "binary array" list after which it will only ever contain zeroes, to effectively convert the infinite list into a finite list.
In reply to Re: sequence of positions to binary sequence
by Corion
in thread sequence of positions to binary sequence
by coldy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |