http://www.perlmonks.org?node_id=1047302


in reply to serving an image with dancer and GD

send_file wants to send a file, which must exist on disk, with a name, on the server. You maybe just want to return $im->png as the result of the request?

Also, what is DISPLAY supposed to be/do? I recommend using lexical filehandles over using global filehandles.