say for unpack "d*", $contents; # To print them as you were. #### my @numbers = unpack "d*", $contents; # To store them in an array.