in reply to Re^2: Use pack to create a float in non-native format
in thread Use pack to create a float in non-native format
I didn't think to try the built-in big-endian conversion, because you said you'd already tried reversing the bytes. And that's all it does.
I missed that you'd forgotten the scalar context requirement:
print unpack 'H*', pack 'f>', 123.456;; 42f6e979 print unpack 'H*', scalar reverse pack 'f', 123.456;; 42f6e979
|
|---|