Code:
#!/usr/bin/perl
eval {
require "default.cfg";
require "html.pl";
require "db.cgi";
};
$@ and &cgierr ("Error loading required libraries : $@"); }
print "Content-type: text/html\n\n";
my $path = "/path/to/build/pages";
my @bla = ();
open (DB, "<$db_file_name") or &cgierr("Can't open db : $!");
while (<DB>) {
chomp;
@bla = split /\|/;
open (F, ">$path/$bla[0].html") or &cgierr("Can't open db : $!");
my (%rec) = &get_record($bla[0]);
print F &html_record(%rec);
close F;
print "Detailed Page $bla[0]....created!";
}
close DB;
Well that's the general idea. I've not tested it so it is guaranteed not to work but feel free to let me know if it craps out.
You can change &html_record(%rec) to whatever you want but I don't use short/long so I can't give an example with that code at the moment.