use strict; use warnings; my $diafile="RT_4.dia"; open(FDIA, $diafile) or die "cannot open $diafile"; my $read_len = 8; my $tot_len  = 0; my $file_len = (stat($diafile))[7]; print "Dateigroesse $file_len Bytes\n"; while ( my $len = sysread(FDIA, my $rec, $read_len) ) { # bis eof lesen   if (!defined $len) {      next if $! =~ /^Interrupted/;      die "system read error: $!";   }     # $rec Verarbeitung   $tot_len += $len;   warn "read $tot_len/$file_len\n"; }