You could try something like:
use constant READSIZE => ...; my $fh = ...; my $start = ...; my $end = ...; ## check $end < -s($fh)! seek $fh, $start, 0; while( ($_ = tell( $fh ) ) < $end ) { local $/ = \min( READSIZE, $end - $_ ); my $chunk = <$fh> or die $!; ## ... }
In reply to Re^3: Byte ranges of binary files
by BrowserUk
in thread Byte ranges of binary files
by PearlsOfWisdom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |