Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Process to fix a broken CPAN module?

0 views
Skip to first unread message
Message has been deleted

Jens Thoms Toerring

unread,
May 6, 2008, 4:59:40 AM5/6/08
to
goo...@obmac.org wrote:
> I have found a major flaw in a CPAN package. The package is
> File::Binary and it has big endian and little endian unpack-ing
> backwards. Likewise, all the test files are reversed so that the
> tests all pass!

> Why do I believe this is true?

> From the perl manual on pack:
> n,N unpacks a 16 or 32 bit integer in "network" or big endian order
> v,V unpacks a 16 or 32 bit integer in "VAX" or little endian order

> From the code:
> if ($endian == $BIG_ENDIAN) {
> $self->{_ui16} = 'v';
> $self->{_ui32} = 'V';
> } else {
> $self->{_ui16} = 'n';
> $self->{_ui32} = 'N';
> }

> When I 'od -x' the test files, they are clearly reversed:

> od -x be.power10.n32.ints
> 0000000 ffff ffff f6ff ffff 9cff ffff 18fc

I hope you do realize that 'od -x' does reverse the bytes when
used on a little endian system. Just create a file that only
contains two letter, e.g. first 'a' and then 'b'. Now look at
the file with 'od -x' and you will find (at least if you're
on a little endian system)

0000000 6261

i.e. the 'b' seems to come first and only then the 'a'.
That's because the '-x' option makes od deal with two
bytes at once. If you want to see what's really in the
file in a byte-by-byte fashion use instead

od -t x1 filename

(or e.g. load the file into emacs and switch to hexl-mode).

> OK, so there is a mistake here -- I would like to submit a fix to all
> this -- my question is how do I go about doing this? I have contacted
> the author, but no response.

It looks as if the module is actively maintained (the last
version was uploaded on Aril 1st, 2008). How long did you
give the author to reply? Did you consider that he could
be on vacation and not able to read emails at the moment?

Best regards, Jens
--
\ Jens Thoms Toerring ___ j...@toerring.de
\__________________________ http://toerring.de

rthangam

unread,
May 6, 2008, 8:14:43 AM5/6/08
to


Which CPAN module are you taking about ?. Every CPAN module has a link
'Report a bug' where you can log a bug. Try it out may be you might
get some response

0 new messages