#!/usr/bin/perl -w use strict; my $template = get_file ( 'c:/some/template.htm' ); my $textfile = get_file ( 'c:/some/textfile.txt' ); $template =~ s//$textfile/ or die "No token!"; print "Content-Type: text/html\n\n"; print $template; sub get_file { my $file = shift; open FILE, $file or die "Can't open $file $!\n"; local $/; my $content = ; return $content; }