#!/usr/bin/perl use strict; my @pos = qw( 2 4 6 9 ); my @bin; for (my $i = 0; $i < $pos[-1] + 1; $i++ ) { my $counter = 0; $counter = 1 if ( grep /$i/, @pos); push( @bin, $counter ); } print join ",", @bin;
In reply to Re: sequence of positions to binary sequence
by bichonfrise74
in thread sequence of positions to binary sequence
by coldy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |