#!/usr/bin/perl -w
use Time::localtime;
use Jcode;
use NKF;
$folder="/var/www/DAV/2002-05-17";
$output = nkf("-j", $page_header);
print $output;
chdir "$folder";
opendir DAVFOLDER, "$folder";
while( defined ($name = readdir(DAVFOLDER)) ){
if (! -f $name) {next;}
$jis_name = Jcode->new($name)->h2z->jis;
($mtime) = (stat($name))[9] or next;
$time{$jis_name} = $mtime;
}
closedir DAVFOLDER;
@skeys = sort { $time{$b} <=> $time{$a} } keys %time;
for(@skeys){
$tm = localtime($time{$_});
printf("%s %04d-%02d-%02d %02d:%02d:%02d %s
\n",
$iconlink,
$tm->year+1900,
$tm->mon+1,
$tm->mday,
$tm->hour,
$tm->min,
$tm->sec,
$_);
}
$output = nkf("-j", $page_footer);
print $output;
# ------------- end of script ----------------
BEGIN {
$page_header = <<'EOM';
Content-type: text/html; charset=iso-2022-jp
レポートフォルダの提出状況です。新しい順に並んでいます。
EOM $page_footer = <<'EOM';