in reply to Page Templates
$templatefile = "template.html"; open(LOCAL, "<$templatefile") || &error('Cannot Open Template File'); if ($^O eq "dos") { binmode LOCAL; } else { flock(LOCAL, 2); } @template = <LOCAL>; close LOCAL or &error('Cannot Close New File'); foreach $line(@template) { $line =~ s/<insert item1>/$item1/g; $line =~ s/<insert item2>/$item2/g; $line =~ s/<page body>/$pagecontents/g; print "$line"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
2Re: Page Templates
by jeffa (Bishop) on Feb 11, 2004 at 16:55 UTC |