--- comics/fetch.pl.new 2013/02/26 14:24:14 1.10 +++ comics/fetch.pl.new 2013/03/01 14:38:47 1.12 @@ -9,7 +9,7 @@ use Getopt::Long; ## ## Some default values ## -my $ver = q/$Id: fetch.pl.new,v 1.10 2013/02/26 14:24:14 nick Exp $/; +my $ver = q/$Id: fetch.pl.new,v 1.12 2013/03/01 14:38:47 nick Exp $/; my $comicFile = "comics.conf"; my %comics = &readComicConfig ( $comicFile ); my %opts = &fetchOptions( ); @@ -116,9 +116,10 @@ sub readComicConfig ($$) { ####################################################################### sub writeComic ($$) { my ( $comics, $comic, $date ) = @_; - my $indexFile = $indexDir . "/index-" . $days[$date->{'dow'}] . - "-" . $date->{'year2'} . $date->{'mon2'} . - $date->{'day2'} . ".html"; + my $sd = substr( join( '', $days[$date->{'dow'}] ), 0, 3 ); + my $indexFile = $indexDir . "/index-" . $date->{'year2'} . + $date->{'mon2'} . $date->{'day2'} . "-" . + $sd . ".html"; my $content = <{$comic}{'fullName'}) ******* --> @@ -171,9 +172,10 @@ sub writeMainIndex ($$) { ####################################################################### sub writeFooter { my ( $date ) = @_; - my $indexFile = $indexDir . "/index-" . $days[$date->{'dow'}] . - "-" . $date->{'year2'} . $date->{'mon2'} . - $date->{'day2'} . ".html"; + my $sd = substr( join( '', $days[$date->{'dow'}] ), 0, 3 ); + my $indexFile = $indexDir . "/index-" . $date->{'year2'} . + $date->{'mon2'} . $date->{'day2'} . "-" . + $sd . ".html"; my $sysDate = `date`; open INDEX, ">>$indexFile"; @@ -210,9 +212,10 @@ sub checkDir ($$) { ####################################################################### sub writeTitle ($$) { my ( $date ) = @_; - my $indexFile = $indexDir . "/index-" . $days[$date->{'dow'}] . - "-" . $date->{'year2'} . $date->{'mon2'} . - $date->{'day2'} . ".html"; + my $sd = substr( join( '', $days[$date->{'dow'}] ), 0, 3 ); + my $indexFile = $indexDir . "/index-" . $date->{'year2'} . + $date->{'mon2'} . $date->{'day2'} . "-" . + $sd . ".html"; my $today = $days[$date->{'dow'}] . " " . $date->{'mon'} . "/" . $date->{'day'} . "/" . $date->{'year'}; open INDEX, ">$indexFile";