in reply to Printing, analyzing binary

Use the %08b format of sprintf.

It is easy to count ones and zeros if you do convert to a string (it has to be done to print, anyway). my $zeros = tr/0//; will do fine. Assumes the string is in $_.

After Compline,
Zaxo