I never thought to use map to reverse bit order. Actually the combination I needed was based on the last two.
unpack("V",pack("B32",join("",map {vec($data_to_convert,31-$_,1)} 0..31)))Convuluted, but it works. This is to read in dword values from Palm databases for things like date/time, convert to perl-friendly bit/byte order, then it can be converted using gmtime(). Thanks BrowserUk.
In reply to Re: Bit order
by spoulson
in thread Bit order
by spoulson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |