#!perl -w $| = 1; use strict; use CGI; my $CGI = CGI->new(); print $CGI->header('text/html'), <<'END_HTML'; Sample Image Page END_HTML #### #!perl -w $| = 1; use strict; use CGI; my $CGI = CGI->new(); print $CGI->header('image/gif'); open( my $img, '<', 'packplan.gif' ) or die("open failed: $!"); binmode($img); binmode(STDOUT); while ( read($img, my $buf, 1024) ) { print $buf; } close($img) or die("close failed: $!");