summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-18 08:22:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-18 08:24:16 +0200
commitf37a988533a55020ad7a397b0be4b5bad6151a4a (patch)
tree1186ac607764b64895ff834c3424d74056cb0bfc /bin
parenta146fdcd6fb2ad84625c29876c1fd1a780fbf0b3 (diff)
Do not use autodie. Not counting disk IO, this increases performance by ~25%
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hashl8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/hashl b/bin/hashl
index 30b3993..40875ee 100755
--- a/bin/hashl
+++ b/bin/hashl
@@ -5,11 +5,9 @@
use strict;
use warnings;
use 5.010;
-use autodie;
use App::Hashl;
use Cwd;
-use Digest::SHA qw(sha1_hex);
use File::Copy;
use File::Find;
use Getopt::Long;
@@ -90,7 +88,8 @@ sub copy_file {
mkdirs($incoming_dir, $base);
}
- copy($file, "${to}/${base}");
+ copy($file, "${to}/${base}")
+ or die("Cannot copy ${file} to ${to}/${base}: $!\n");
}
sub db_find_new {
@@ -192,7 +191,8 @@ sub mkdirs {
for my $dir (split(qr{/}, $new)) {
$base .= "/$dir";
if (! -d $base) {
- mkdir($base);
+ mkdir($base)
+ or die("Cannot create ${base}: $!\n");
}
}
}