in reply to Unpack for VMS binary files
You seem to be under the impression that i8 is how you represent int(8). It is not length it is a repeat count so i8 == 'iiiiiiii' or 8 integers 32 bits (4 bytes) wide. A short is 2 bytes.
Here is a more or less complete list of the integer the templates to try. I suspect 'Qssssssssssss' or 'Qvvvvvvvvvvvv' will be close. You will have to use 'LL' or instead of 'Q' if this is not supported on your system. Shorthand is 'Qs12' 'Qv12'
cheerss A signed short value. 16 bits = 2 bytes S An unsigned short value. (This 'short' is _exactly_ 16 bits, which may differ from what a local C compiler calls 'short'.) i A signed integer value. I An unsigned integer value. (This 'integer' is _at least_ 32 bits wide. Its exact size depends on what a local C compiler calls 'int', and may even be larger than the 'long' described in the next item.) l A signed long value. L An unsigned long value. (This 'long' is _exactly_ 32 bits, which may differ from what a local C compiler calls 'long'.) n A short in "network" (big-endian) order. N A long in "network" (big-endian) order. v A short in "VAX" (little-endian) order. V A long in "VAX" (little-endian) order. q A signed quad (64-bit) value. Q An unsigned quad value. (Available only if your system supports 64-bit integer value +s _and_ if Perl has been compiled to support those. Causes a fatal error otherwise.)
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|