How to read binary file in Perl 

Joined:
04/09/2007
Posts:
710

May 23, 2010 01:16:57    Last update: May 23, 2010 01:16:57
open(IMG, "Sample.jpg") or die "Can't open file: $!";
binmode IMG;
binmode STDOUT;

while (read(IMG, $buff, 8 * 2 ** 10)) {
    print $buff;
}
close IMG;
Share |
| Comment  | Tags
 
Easy email testing with http://www.ximailstop.com