#! /usr/bin/env perl # Ed Hill # Tue Dec 2 20:17:27 EST 2003 # Assemble the web pages from XML files. open(TOP,") { chomp($line); length($line) > 0 and @top_list[$top_list++] = $line; } open(TEMPL,"; mkdir html; foreach $file (@top_list) { $fname = "<./" . $file . ".xml"; open(INF,$fname) or die "ERROR: can't open \"$fname\"\n"; $f_all = join "", ; $_ = $f_all; /(.*)<\/body>/s and $body = $1; $_ = $f_all; /" . $f . "
\n"; } else { $tmp = "" . $name . "\n"; } $menu = join "", $menu, $tmp; } $_ = $template; s//$title/s; s//$menu/s; s//$body/s; $out_name = ">./html/" . $file . ".html"; open(OUT,$out_name) or die "ERROR: can't open \"$out_name\"\n"; print OUT $_; close(OUT); close(INF); }