in reply to pack/unpack 6 bit fields.
Enjoy.# to turn your $str into an array @array = map { vec($str, $_*6, 6) } 0..15; # to turn an array of 6-bit items into a packed string vec($str, $_*6, 6) = $array[$_] for 0..$#array; # or simply to access the $i-th item in the $str, directly: $read_item = vec($str, $i*6, 6) = $write_item; # vec is an lvalue!
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pack/unpack 6-bit fields.(!vec)
by tye (Sage) on Aug 18, 2004 at 05:33 UTC |