34 open(F,$f) || die "OPEN : $!\n"; 35 binmode(F); 41 FILE:{ 42 if(($fsize - $size)<=0) { 43 my $count=0; 44 print "Creating file $nr\n"; 45 open(C,">$nr") || die "CREATE : $!\n"; 46 while($count != $fsize) { 47 $count+=read(F,$buffer,$BUFFER_SIZE); 48 print C $buffer; 49 } 50 close C; 51 last FILE; 52 } 53 else { 54 my $count=0; 55 print "Creating file $nr\n"; 56 open(C,">$nr") || die "CREATE : $!\n"; 57 while($count != $size) { 58 $count+=read(F,$buffer,$BUFFER_SIZE); 59 print C $buffer; 60 } 61 close C; 62 $fsize-=$size; 63 $nr++; 64 redo FILE; 65 } 66 }