use strict;
MAIN:
{
open(STDERR, ">&STDOUT");
chdir $ARGV[0] || die "\ncan't process directory $ARGV[0]\n" ;
open (fileList, '>FILE_LIST.XML') || die "Can't open FILE_LIST.XML";
printf fileList "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \n <file-list>";
printf fileList "\n";
foreach(glob('*.*'))
{
if ($_ =~ /FILE_LIST/) {next;}
my($mtime) = (stat($_))[9];
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime ($mtime + 3600);
printf fileList "<file name=\"$_\" year=\"" . ($year + 1900) .
"\" month=\"" . ($mon + 1) .
"\" date=\"" . $mday .
"\" hour=\"" . $hour .
"\" minute=\"" . $min .
"\" second=\"" . $sec .
"\" timezone=\"Eastern\"/>";
printf fileList "\n";
}
print fileList "</file-list>";
close (fileList);
}