Help for this page

Select Code to Download


  1. or download this
    my ($pos, $aw, $stru) = (2, 5, 6);
    my $bits = sprintf('%06b%05b%03b%02b', 0, $stru, $aw, $pos);
    ...
    my $bstr=pack('b16', $bits);
    printf "<$bstr> is %d bytes\n", length($bstr);
    print "\nUnpack: ", unpack('B*', $bstr), "\n";