in reply to <img> tag does not work in my perl/cgi code

Just a wild guess... but I'd say your webserver is configured to treat files in /cgi-bin as scripts and can therefore not show it. But I might be completely wrong. In any case, cgi-bin is for scripts, not for images. Those belong in another folder , depending on your webserver's configuration.

Best of luck!