$ perl -we 'my $pi = 4*atan2(1,1); print pack "f", $pi' > le-pi.bin $ od -h le-pi.bin 0000000 0fdb 4049 0000004 #### $ perl -we 'my $buf; read STDIN, $buf, 4; my $pi = unpack "f", reverse $buf; print "pi=$pi\n";' < le-pi.bin pi=3.14159274101257 #### # reverse endianness of first 4-byte float: substr( $buf, 0, 4 ) = reverse substr( $buf, 0, 4 );