Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But that doesn't seem very elegant.read FILE, $myinput, 3; ($byte1, $byte2, $byte3) = unpack('C3', $myinput); $myinteger = (65536 * $byte1) + (256 *$byte2) + $byte3;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I read a 24 bit integer?
by JavaFan (Canon) on Jan 01, 2010 at 14:44 UTC | |
by Anonymous Monk on Jan 01, 2010 at 15:42 UTC | |
by JavaFan (Canon) on Jan 01, 2010 at 17:15 UTC | |
by Anonymous Monk on Jan 02, 2010 at 11:13 UTC | |
by JavaFan (Canon) on Jan 02, 2010 at 11:28 UTC | |
| |
|
Re: How do I read a 24 bit integer?
by AnomalousMonk (Archbishop) on Jan 01, 2010 at 21:02 UTC | |
|
Re: How do I read a 24 bit integer?
by Anonymous Monk on Jan 02, 2010 at 12:19 UTC | |
by juster (Friar) on Jan 03, 2010 at 18:43 UTC |