#### #!/usr/local/bin/perl # Usage: perl "thisfile.pl inputfile.txt" use warnings; use strict; use HTML::Template; my $title = "Page Title"; # or a variable representing a # command-line argument, or # something extracted from your # input file. my $text; { local $/ = undef; $text = <>; } $text =~ s/\b(myword)\b/$1 /g; my $template = HTML::Template->new(filename => 'my_template.tmpl'); $template->param(date => "$title"); $template->param(date => "$text"); print $template->output;