my $x = 0b01001001; my $hi = ($x & 0b11110000) >> 4; $hi = $hi . " (four)"; print "The answer was $hi"; #The answer was 4 (four)