in reply to Re: perl in DOS woes
in thread perl in DOS woes
From your description, unpack would be perfect for your purposes.
For example, if your file has 3 16-bit integers, 2 32-bit integers and 4 1-byte ascii fields, getting them into seperate scalars would be as simple as
my ($int16_1, $int16_2, $int16_3, $int32_1, $int32_2, $c_1, $c_2, $c3, + $c_4) = unpack'S3 L2 C4', $scalar_18_bytes;
And there are format specifiers for just about every conceivable sort of datatype, size and -endian that you are likely to encounter.
|
|---|