Embed HTML directly into your Perl code. Just be sure you're using warnings.
package HTML;
$SIG{__WARN__} = sub {
if ($_[0] =~ /readline\(\) on unopened filehandle (\S+)/) {
print "<$1>";
}
elsif ($_[0] !~ /only once/) { warn @_ }
};
sub import {
my $pkg = caller;
*{ $pkg . "::glob" } = \&tag;
}
sub tag {
my $tag = shift;
$tag =~ s/\s+$//;
wantarray ? "<$tag>" : print "<$tag>";
}
1;
__END__
#!/usr/bin/perl -w
use HTML;
print
<html>,
<head>,
<title>, "This is vile", </title>,
</head>,
<body bgcolor="#ffffaa">,
<tt>, "japhy", </tt>, " is insane.",
</body>,
</html>,
;