in reply to Images built on the fly do not display

FamousLongAgo touches on the problem: unless you let the browser know the MIME type of the server's response ("image/png" in this case), it won't know what to display.

Scanning over your snippet, the other thing that jumped out is that you're using the single-argument form of exec(), which has a hidden performance penalty. (See perlfunc, and read carefully.)

But do you really need a fork()/exec() here? Wouldn't using system() give you the same effect with less hassle? Note, though, that system() has the same hidden overhead as exec() when called with a single argument.