foreach my $i ( 0 .. 8 * length $bools ) { push @trues, $i if vec( $bools, $i, 1 ); }