hail oh reverend gurus, a lowly initiate seeks advice at your everlasting fountain of knowledge. :)

there's a task of reading binary data from a file, parsing it and printing it out in csv text file. there are two known formats of binary file, both documented. in perspective, there may be more formats so i would like to keep parsing code as generalized as possible. the holy unpack is good but there's a catch (as always). the data record format is about that:
the catch itself is that all the data is little-endian but the platform used to run a software producing such binary data is big-endian (sparc64). the conversion script should run on the sparc.

so there's my humble question: is there any way to do the parsing elegantly? i did the parsing quick and dirty way but i know that's a sin. my view of heaven for this case is the holy unpack to be able to parse the whole record in one pass. i tried to meditate on perlpacktut for three days but nothing comes to my mind short of divine intervention in form of some signed "v" template and that doesn't solve bit-string matter in which every bit is a separate field...

oh, and another complication: the system that produces the binary data is proprietary and it's using solaris 9 as a platform so it would be best to avoid any modules not built in perl 5.6.1 that is already there. no cc. :( ideally it should be a small beautiful self-containing perl hack but... i feel i have reached the limit of my humble perl knowledge so i ask your advice, oh gurus!

In reply to yet another "reading binary data" question by dwalin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.