in reply to Re: Unpack for VMS binary files
in thread Unpack for VMS binary files

Thanks for the tips. I should not that I'm running perl on a unix machine (Solaris)... So the length of things are: <code> int: 4 long: 4 float: 4 double: 8 <code> Stacy.

Replies are listed 'Best First'.
Re: Re: Re: Unpack for VMS binary files
by pfaut (Priest) on Feb 19, 2003 at 02:58 UTC

    In that case, there are probably endian differences. VMS is little endian and I think Solaris is big endian. Use 'V2 v12' (first V is capitalized, second is not) instead. That says two longs in VAX (little endian) order followed by 12 shorts in VAX order.

    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
      You are god! The differences between little endian (VMS) and big endian (Solaris) and the format you provided made the difference. Many thanks... Now to try and convert VMS time to something readable (urrgg). Regards, Stacy.
        I wrote a pure-perl VMS time to Unix time converter at one point. I can't find the original, but courtesy of google I find it quoted in a mail reply here.