#!/usr/bin/perl
use CGI':all';use File::Find;$n=param('n')||0;@i=split'/',path_info;shift@i;($y,
$m,$d)=grep{/^\d+$/}@i;$p=join'/',grep{/^\D+$/}@i;find sub{($f=$File::Find::name
)=~/\.txt$/and$e{$f}=-M},"./$p";put header,start_html;for((sort{$e{$a}<=>$e{$b}}
keys%e)[$n..$n+40]){($z,$x,$c)=(localtime(time-60*60*24*$e{$_}))[5,4,3];next if(
($y&&$y!=$z+1900)or($m&&$m!=$x+1)or($d&&$d!=$c)or!-f);s/^\.\///;open(F,$_)&&{
chomp($t=<F>),put(a({-href=>url."/$_"},h2 $t),<F>,hr,"\n"),close F}}put end_html