#!"C:\xampp\perl\bin\perl.exe" use strict; use warnings; use CGI; my $query = CGI->new ; my $dir = "C:/Users/41786/Documents/recordz1/"; showImage(); sub showImage { my $call = shift || ''; my $image = $query->param('article'); my $URL = "../upload/$image.jpg"; my $content; if (defined $image) { open (FILE, "<$dir/show_image.html") or die "cannot open file $dir/show_image.html"; while () { s/\$ARTICLE{'url_image'}/$URL/g; $content .= $_; } } print "Content-Type: text/html\n\n"; print $content; close (FILE); return 1; }