in reply to Reading binary file byte by byte
{ local $/ = chr(0); # if this occurs reasonably often in the file open (FILE, "file.binary"); while ( <FILE> ) { while ( length() ) { my $byte; ( $byte, $_ ) = /^(.)(.*)$/; ... Code here, processing $byte ... } } close FILE; }
One world, one people
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading binary file byte by byte
by ikegami (Patriarch) on Dec 21, 2010 at 18:02 UTC | |
by anonymized user 468275 (Curate) on Dec 23, 2010 at 13:26 UTC | |
by ikegami (Patriarch) on Dec 23, 2010 at 16:03 UTC | |
|
Re^2: Reading binary file byte by byte
by AnomalousMonk (Archbishop) on Dec 21, 2010 at 17:44 UTC |