Hi everybody (annoyingly enthusiastic first post approaching),

Please smack me if this is the wrong list on which to discuss this  
issue but I've found an interesting little (no pun intended) endian  
bug in String#unpack.

Try this on a Mac running tiger ...

#!/bin/sh -

echo PERL BE
perl -e 'print unpack ("N", "\0\0\0\1") . "\n"'
echo PERL LE
perl -e 'print unpack ("V", "\0\0\0\1") . "\n"'
echo RUBY BE
ruby -e 'puts "\0\0\0\1".unpack("N")'
echo RUBY LE
ruby -e 'puts "\0\0\0\1".unpack("V")'

The output _should_ be....

PERL BE
1
PERL LE
16777216
RUBY BE
1
RUBY LE
16777216

...however the ruby unpack actually gets the two Ruby results  
reversed on all the machines I have access to. Is this a known  
problem? Another random Apple-compiled Ruby breakage perhaps?

Cheers,

Andre Ben Hamou
Systems Architect
www.freedom255.com

--

...and, on the seventh day, God switched off his Mac.