#!/usr/local/bin/perl -w use myCPAN; my $url = "http://www.perl.com/CPAN-local/modules/01modules.index.html"; $|++; if (@ARGV) { open(MODULES,"01modules.index.html"); } else { print "Content-type: text/html\n\n"; open(MODULES,"./GET " . $url . " |"); } my @header; my $hdr = 0; my $base = "\n\n"; while () { unless ($hdr) { s/Modules/Recent $&/ if m/^Modules/; s/<\/TITLE>/$&$base/ if m/<\/TITLE>/; if (m/^<PRE>/) { push @header, "<H2>Recent Updates Only</H2>\n", "<HR>\n"; } push @header, $_; next unless m/^module/; print join("\n",@header); $hdr++; next; } # Show me the body! print $_ if m/\+$/; } print "</body></html>\n"; exit 0;