use CGI::Simple;
use File::Find;
use File::stat;
+use File::Basename qw(dirname);
+use POSIX;
my $q = CGI::Simple->new({num=>100});
-my $cat_dir = '/home/don/debian/.cat/';
+my $cat_dir = dirname($ENV{SCRIPT_FILENAME});
my %pics;
my $num = 0;
my $previous_date = '';
for my $pic (sort {$pics{$b}->ctime <=> $pics{$a}->ctime} keys %pics) {
- my $this_date = POSIX::strftime('%Y-%m-%d',time($pics{$pic}->ctime));
+ my $this_date = POSIX::strftime('%Y-%m-%d',localtime($pics{$pic}->ctime()));
if ($previous_date ne $this_date){
print "<p>$this_date</p>\n";
- $this_date = $previous_date;
+ $previous_date = $this_date;
}
my $basename = $pic;
$basename =~ s/\.html//;