#just two lines my @bits= (0) x 15; $bits[$_] = 1 for @pos; #...and print the output print "<@bits>\n";