Help for this page

Select Code to Download


  1. or download this
    sub str_from_bits {
        my $vec = '';
    ...
        my $vec = shift;
        grep vec( $vec, $_, 1), 0 .. 8*( length $vec);
    }
    
  2. or download this
    my $vec = str_from_bits( 8, 1, 9);
    my ( $lo, $hi) = ( vec( $vec, 0, 8), vec( $vec, 1, 8));
    printf "lo: 0x%02x, hi: 0x%02x\n", $lo, $hi;