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
In reply to Re: Printing, analyzing binary
by Zaxo
in thread Printing, analyzing binary
by perlfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |