$category = $ENV{REQUEST_URI};
$category =~ /\/beta\/(.+)/;
# acton is the product code
$acton = "$1";
... and later ...
open(CATALOG, "catalog.txt");
while ($line=<CATALOG>) {
if ($line =~ /\t$acton\t/is) {
($template, $product, $title) = split("\t",$line);
... and later ...
open(TEMPLATE, "$template.html");
$good = read TEMPLATE, $html, 100000;
close(TEMPLATE);
$html =~ /<title>(.+)</;
$html ="$`<title>$title<$'";
$html =~ /[[product]]/;
$html ="$` $product $'";
}
print "$html";
... and later
close(CATALOG)