Are you certain there's at least 4096 bytes in the SQL dump? The read would return an undef if that's not the case. Then the while block wouldn't get executed.
Erm, no. read will try to read up to 4096 and will return the number actually read (0 on eof, or undef if there's an error like trying to read when there's no data on a non-blocking handle).
The cake is a lie.
The cake is a lie.
The cake is a lie.