in reply to comparison with bitwise operators

If you mean you want to test if the 2's place is set, you can use bitwise operators (see Bitwise And and Bitwise Or and Exclusive Or in perlop). Something like

#!/usr/bin/perl use strict; use warnings; for my $value (1, 2, 3, 4, 5, 6, 7, 8) { print "$value: "; if ($value & 0x2) { print "yes\n"; } else { print "no\n"; } }

This was recently discussed in Bit operation.