spoulson has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a parser for a certain Palm database file and I get to run into all the differences between m68k and the way Perl works.
I extract a dword from a file into $var and I want to turn it into an integer, i.e.:
$i = unpack("V", $var);
Only that unpack doesn't give me a usable number. Perl is giving me the _right_ number compared with a hex editor, but the number I really want is apparently in a different bit order, which I believe is descending order.
How can I unpack that value and change bit order?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bit order
by BrowserUk (Patriarch) on May 21, 2003 at 20:34 UTC | |
by spoulson (Beadle) on May 21, 2003 at 20:54 UTC | |
|
Re: Bit order
by halley (Prior) on May 21, 2003 at 20:02 UTC | |
by spoulson (Beadle) on May 21, 2003 at 20:05 UTC | |
by halley (Prior) on May 21, 2003 at 20:33 UTC | |
|
Re: Bit order
by jmcnamara (Monsignor) on May 22, 2003 at 09:26 UTC |