} elsif ($ARGV[0] eq "htmls") {
my $now = time;
use File::Path qw(make_path);
+ use File::Copy;
foreach my $cat (keys %cats) {
make_path "$ARGV[1]/$cat";
next if (exists $mtimes{"$cat/index"});
close $fh;
@s = stat($pth) or die "$!";
utime $s[9], $s[9], "$ARGV[1]/$pth.html";
- open(my $in, "<", $pth) or die "$!";
- open(my $out, ">", "$ARGV[1]/$pth.txt") or die "$!";
- while (<$in>) { print $out $_ };
- close $out;
- close $in;
+ copy $pth, "$ARGV[1]/$pth.txt" or die "$!";
utime $s[9], $s[9], "$ARGV[1]/$pth.txt";
}
} elsif ($ARGV[0] eq "dot") {