For some reason in mod_perl it never goes past the null padding line.
What direct observation are you making that lead you to conclude that?
If you comment out the padding line does it correctly print the length of the unpadded string?
Have you put a die() or similar after the padding to see if execution is really reaching that point?
It seems much more likely that something you are doing later in the script with the null bytes is causing a mode of failure that prevents the data that's been written to response from appearing on the client.