[Pdx-pm] PowerPC and little-endian

Tom Phoenix rootbeer at redcat.com
Tue Feb 28 19:06:10 PST 2006

On 2/28/06, Eric Wilhelm <scratchcomputing at gmail.com> wrote:

> I need to unpack some floats and doubles in a cross-platform way and yeah
> I could do that in pure perl with some of the portable pack/unpack
> commands and some byte twiddling, but that's going to be slow

Maybe. But who says any other way will be much faster?

> so I was thinking I
> could compile perl to run in little-endian mode.

That would be a challenge. Are you hoping that Perl's internal format
for floats and doubles will be a close match for the file format?
There may be an easier way.

You could perhaps use Inline to compile a small routine to do the
unpacking you need. But try writing that routine in Perl, first. You
may find that optimizing your code (by using Inline) won't help as
much as you'd think, especially before you've finished debugging.

Good luck with it!

--Tom Phoenix

More information about the Pdx-pm-list mailing list