in reply to Re^3: Chunking very large files
in thread Chunking very large files

What about the end of the file where $sizeRead will be smaller than chunkSize?

Replies are listed 'Best First'.
Re^5: Chunking very large files
by SuicideJunkie (Vicar) on Nov 09, 2011 at 20:19 UTC

    In that case, $sizeRead will be smaller than $size. Possibly zero if your file is exactly a multiple of the chunk size. You then write the chunk as normal (unless its size zero), and the while loop exits.