I just re-read your orginal messge where you said there would be a
template. In that case the details will vary depending on what types of
information you want to send and whether to want to replace the existing
info or if you want to add to it, but it'll look a lot like this:
HTML Code:
#!/usr/bin/perl
my $htmlpage = '../domain/public_html/blah.html';
my $template = '../domain/public_html/blah.tmpl';
open TMPL, $template or die "Could not open '$template': $1";
my @lines = <TMPL>;
close TMPL;
my $tmplhtml = join("\n", @lines);
while (my $line =<STDIN> ) {
$line =~ s/[^a-zA-Z0-9\n\s\:]//g; # allow just letters, numbers, spaces, and colons
if ($line =~ m/([^:]*): (.*)/) {
$find = $1; $replace = $2;
$tmplhtml = s/$find/$replace/g;
}
}
open HTML ">$htmlpage" or die "could not open '$htmlpage': $!"
print HTML $tmplhtml;
close HTML;
Bookmarks