diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-06 23:09:40 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-06 23:09:49 +0200 |
commit | fd6ffbd6b8e616a9cbb777a420ecf08aae56d7d6 (patch) | |
tree | f28d1007f0a6ac827e79bac4dd96995c84d3741a | |
parent | 2ce71d84357a85966a121dec6ee5ca605ab04b8e (diff) | |
download | perlisdead-fd6ffbd6b8e616a9cbb777a420ecf08aae56d7d6.tar.gz |
Fix static file copying
stat may return undef
-rwxr-xr-x | gen.pl | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -91,7 +91,8 @@ opendir $out, 'out' or die "Could not open directory src: $!"; my %src = map { ($_, (stat "src/$_")[9]||0) } grep { not /^\./ or /^index\.html$/ } readdir $src; my %out = map { ($_, (stat "out/$_")[9]||0) } grep { not /^\./ or /^index\.html$/ } readdir $out; for (keys %src) { - if ($out{$_} and $src{$_} > $out{$_}) { + no warnings 'uninitialized'; + if ($src{$_} > $out{$_}) { print STDERR "COPY: src/$_ => out/$_\n" if $opt{d}; copy "src/$_" => "out/$_"; } |