Re: Reading binary files in Perl

2004-05-06 Thread John W. Krahn
Paul Harwood wrote: > > I am trying to read a binary file with the following code: > > $filename = "binary_file.rpy"; > open(FILE, $filename) or die "can't open $filename: $!"; > > binmode(FILE); > binmode(STDOUT); > > while (read(FILE, $buff, 8 * 2**10)) { > print STDOUT $buff; > }

Reading binary files in Perl

2004-05-06 Thread Paul Harwood
I am trying to read a binary file with the following code: $filename = "binary_file.rpy"; open(FILE, $filename) or die "can't open $filename: $!"; binmode(FILE); binmode(STDOUT); while (read(FILE, $buff, 8 * 2**10)) { print STDOUT $buff; } I get *some* rea