in reply to Warnings and bitwise and

Thanks in no small part to several of the monks here, I have used the following routine to deal with some "flag bytes" in an IBM Mainframe file. A record is read into $inBuf, then fields are parsed out according to format.
... @Ind0 = BreakOut(substr($inBuf,6,1)); $Flag1= $Ind0[0]; ... $Flag7= $Ind0[7]; ... sub BreakOut { # Convert a single byte into an array of 8 1-bit flags # represented by a Y if ON, or an N if OFF. my $byte = shift; my @flag, $i; for ($i=0;$i<8;$i++) { if (vec($byte,$i,1)) { $flag[7-$i] = "Y"; } else { $flag[7-$i] = "N"; } # End If vec } # End For return @flag; } # End Sub BreakOut