Parse::Flash::Cookie converts (binary, Adobe) flash cookies to text or XML.

The module's tests fail on a number of platforms. I suspect it has to do with unpack and byteorder. However, I don't have access to any of the architectures for which the tests FAIL, so this is pure speculation. The tests that fail are primarily of the kind that read a number and unpack it, but the resulting number isn't what was expected (edited for brevity):

# +----+------------------------+---------+ # | Elt|Got |Expected | # +----+------------------------+---------+ # * 1| 1.12884118761808e-319 | 100 * # * 2| 3.03865194161742e-319 | 1 * # * 6| 1.30222857005357e-314 | 1251997 * # +----+------------------------+---------+
It looks like the tests that FAIL contain
byteorder=4321 byteorder=87654321
while the tests that PASS contain
byteorder=1234 byteorder=12345678
The following unpack templates are used:
return unpack 'C*', $buffer; # bytes return unpack 'C*', reverse $buffer; # int return unpack 'C*', reverse $buffer; # long return unpack 'd*', reverse $buffer; # float return unpack 's*', reverse $buffer; # short
Is it the case that the byte order is the source of the failing tests? How do I make the module work on all platforms?
--
Andreas

In reply to unpack and byteorder - tests fail on certain platforms by andreas1234567

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.