Added "debug" option to cache.pl

master
Hauke D 7 years ago
parent 8f5c7b177b
commit 4718404b50

@ -15,6 +15,9 @@ require File::Spec::Unix;
my $USE_WGET; BEGIN { $USE_WGET=0 }
use if !$USE_WGET, 'HTTP::Tiny';
my $DEBUG; BEGIN { $DEBUG=0 }
use if $DEBUG, 'Data::Dump';
my $CACHEDIR = catdir($FindBin::Bin,'web','cache');
make_path $CACHEDIR;
@ -71,7 +74,7 @@ sub fetch_resource {
else { print STDERR "already fetched\n"; }
my (undef,$path) = fileparse($file);
my $newurl = File::Spec::Unix->catdir(splitdir( abs2rel($cachefn,$path) ));
use Data::Dump; dd $file, $url, $cachefn, $newurl;
$DEBUG and dd($file, $url, $cachefn, $newurl);
return $newurl;
}

Loading…
Cancel
Save