#!/usr/bin/perl -w use strict; my @floats = (1, 2.34, 5.6e8, .001); # Write the floats to a file open BINFILE, ">msfile" or die "Error message here: $!\n"; binmode BINFILE; # Required on Windows print BINFILE pack "f*", @floats; close BINFILE; # Open the file for reading open BINFILE, "msfile" or die "Error message here: $!\n"; { # Read the file in 4 byte chunks local $/ = \4; while (()) { # Unpack the floats print unpack("f", $_), "\n"; } } #### print unpack("f", reverse $_), "\n";