in reply to Odometer pattern iterator (in C). (Updated.)

Perhaps this:
$ perl -E 'say for grep {@b = split //; $c = 0; for $i (@b){$c++ if +$i}; $c == 3} glob "{0,1}{0,1}{0,1}{0,1}{0,1}";' 00111 01011 01101 01110 10011 10101 10110 11001 11010 11100

Update: sorry, forget it, I had missed or forgotten that you don't want to iterate 0 .. N and then count the bits and then eliminate. Saw it just after having posted.