Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!ncar!mephisto!uflorida!bikini!thoth From: thoth@reef.cis.ufl.edu (Gilligan) Newsgroups: comp.lang.perl Subject: unpack and endianness Message-ID: Date: 4 Oct 90 20:22:37 GMT Sender: news@uflorida.cis.ufl.EDU Distribution: comp Organization: Zik Zak Lines: 20 Is there any way to specify the endiannes of the data you are unpacking? I am writing a perl script to decode Moria save files (for unspecified purposes :) and unfortunately for me the data is written in Intel order (LSB first). I can not use unpack (as far as I know) on the data from our Suns (MSB first). If I could get unpack to perform the byte shuffling for me it would squish my code by a factor of two. Does anyone know how to do this? Could it be as simple as read(STDIN, $_, 2*2); ($exp, $maxexp) = unpack("s-2", $_); Also, what is the filehandle for <>, I hate having to type "moriainterp.perl < moria.dc". -- -- "Until it's on my desk, it's vaporware" (`it' is the NeXT)