in reply to Re^2: CGI SCRIPT ITSELF IS DISPLAYED
in thread CGI SCRIPT ITSELF IS DISPLAYED

<img src="file:///var/www/html/index.jpeg" height="420" width="420">

That's not how HTTP works with HTML. Every resource generates its own HTTP request. You will need to serve the image via HTTP too, instead of using the file:// protocol.

You will need to use a file path that is relative to your CGI script. Maybe

<img src="index.jpeg" height="420" width="420">

already is enough, because the image lives in the same folder as your HTML page.

This has very little to do with Perl. I recommend you try it out with a static HTML page and a static image file first.