Please help.
I am trying to create a Binary output file. The file i create with my sub spits out 0's and 1's that can be read in a text editor. I need a Binary file that looks like garbage when you open with a text editor, but dont know enough to ask the right question. Here is the code i'm using:
sub getFloat2Bin {
my ($floatVal) = @_;
my $binaryFloat = unpack("b32", pack("f", $floatVal));
return $binaryFloat;
}
this gives a nice string of 0's and 1's but I am looking for binary output.... any suggestions? deadline is fast approaching.
thanks eric
I am trying to create a Binary output file. The file i create with my sub spits out 0's and 1's that can be read in a text editor. I need a Binary file that looks like garbage when you open with a text editor, but dont know enough to ask the right question. Here is the code i'm using:
sub getFloat2Bin {
my ($floatVal) = @_;
my $binaryFloat = unpack("b32", pack("f", $floatVal));
return $binaryFloat;
}
this gives a nice string of 0's and 1's but I am looking for binary output.... any suggestions? deadline is fast approaching.
thanks eric