read FILE, $myinput, 3; ($byte1, $byte2, $byte3) = unpack('C3', $myinput); $myinteger = (65536 * $byte1) + (256 *$byte2) + $byte3;