You don’t even have to run this as a CGI. You can run it from the command
line and output the results to an HTML file that you have in your webspace.
This allows you to periodically generate this table of contents file, without
having millions of users hammering your CGI. For example you could have cron,
or any other scheduling service periodically execute the command perl–which will rebuild your
toc.pl > /usr/local/apache/htdocs/toc.html
table of contents. Pointing users to the toc.html page might not
give them a real-time view of your webspace, but might be more feasible.
I’d also like to shamelessly plug Lincoln Stein’s CGI.pm module, which is
available on CPAN, and probably is already in your Perl distribution. I use
this module to take a lot of the HTMLizing out of my hands. I wrote this
example using no modules, so you could see what was going on, but I highly
recommend using CGI.pm to do a lot of the HTML stuff for you.
|
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.