#!/usr/bin/perl use strict; use warnings; use CGI ':standard'; if (param('action') eq 'showImage') { # code to open the image file and print contents } else { # code to print the HTML page # this includes an image tag that links back to this # program with the parameter "action=showImage" }