I have to pass there because I don't understand what this has to do with $_ being a default for/foreach parameter.
Well, nothing. $_ is the default variable for a for/foreach loop. That's not the point.
The point here is that the return value of a subroutine or method does not set $_ automatically. You suggested to use a for/foreach loop instead of a while loop, and that will not work because the method "chunk" is a iterator that only returns a single scalar per call. Thus, since for/foreach works on lists, the loops block will only be executed once.
In the while-loop however the block will be executed for every iteration until "chunk" returns false.
To make for/foreach work here, the ChunkReader-class would have to return a list of chunks and that, as said, is a waste of memory.