#!/usr/bin/perl use strict; use warnings; my $bit_flag = 5; #0b101 my @bit_list = qw( 1 2 4 8 16 ); # Assuming you want to test for truth of my above statment # later in the application, binary 1/0 will work fine my $bit_flipped = ( grep{ $bit_flag & $_ } @bit_list ) ? 1 : 0; # Continue on with the application #### print$_ for(map{chr($_)}split(/\s+/,join(/\B?:\w+[^\s+]/,))); __DATA__ 67 111 100 101 32 80 101 114 108