in reply to Outputing image in perl script/cgi

have you set STDOUT to binmode? binmode STDOUT
have you use the right header ? header("image/png")