This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
When endian-swapping in unpack, simply copy the bytes in reverse order.
It is considerably simpler to re-order the bytes before reading them into
the variable of the desired type, than to read into the variable and then
need a specialised "reverse this integer" function for each size of integer.
This should restore support for big endian Crays. It doesn't support
mixed-endian systems. Support for mixed-endian systems can be restored (if
needed) by re-ordering the bytes correctly at the locations which currently
only know how to reverse the bytes.