A
Avalon1178
Hi,
I'm trying to write a PERL program that parses a binary file which
essentially contains the following format:
<float><int><int><int><int><int>
This "record" is repeated throughout the binary file. I'm using
unpack() to extract that information, however, the results I'm seeing
are getting corrupted in PERL v5.8.0 (Linux). I ran the same PERL code
on v5.6.1 Linux (I downloaded it from ActiveState, but didn't "install"
it on my linux system...just cd'ed to the location where the perl
executable lives from this package) and everything works fine. Has
this been observed by anyone else? Is this a known bug in v5.8.0?
Here's the code snippet that I wrote:
$template = "f I5";
$recordsize = length(pack($template,( )));
open(IN, "binFile.bin") or die "Cannot open file";
while (read(IN, $record, $recordsize))
{
($f, $i_1, $i_2, $i_3, $i_4, $i_5) = unpack($template, $record);
print "f=$f, i_1=$i_1, i_2=$i_2, i_3=$i_3, i_4=$i_4, i_5=$i_5\n";
}
If anyone can help I will greatly appreciate it. Thanks.
AV
I'm trying to write a PERL program that parses a binary file which
essentially contains the following format:
<float><int><int><int><int><int>
This "record" is repeated throughout the binary file. I'm using
unpack() to extract that information, however, the results I'm seeing
are getting corrupted in PERL v5.8.0 (Linux). I ran the same PERL code
on v5.6.1 Linux (I downloaded it from ActiveState, but didn't "install"
it on my linux system...just cd'ed to the location where the perl
executable lives from this package) and everything works fine. Has
this been observed by anyone else? Is this a known bug in v5.8.0?
Here's the code snippet that I wrote:
$template = "f I5";
$recordsize = length(pack($template,( )));
open(IN, "binFile.bin") or die "Cannot open file";
while (read(IN, $record, $recordsize))
{
($f, $i_1, $i_2, $i_3, $i_4, $i_5) = unpack($template, $record);
print "f=$f, i_1=$i_1, i_2=$i_2, i_3=$i_3, i_4=$i_4, i_5=$i_5\n";
}
If anyone can help I will greatly appreciate it. Thanks.
AV