summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@chalmers.se>2010-09-26 21:29:13 +0200
committerGuilhem Moulin <guilhem.moulin@chalmers.se>2010-09-26 21:29:13 +0200
commit14c3f3400cd81ac1cc95d87072aebca1e18c28c0 (patch)
tree0acbcc11fb18b72a9902a21a3e8a67638c961671
parentdac0f3cb8b9cd374295ab9c814ee4f9d72a1293b (diff)
... or die "Can't close: $\!'"
-rwxr-xr-xpdftool.pl12
1 files changed, 3 insertions, 9 deletions
diff --git a/pdftool.pl b/pdftool.pl
index 5c331ce..65898fe 100755
--- a/pdftool.pl
+++ b/pdftool.pl
@@ -213,9 +213,6 @@ open *FIN, "<&READ" or die "Can't dup: $!";
# Auxiliary files, to remove
my @auxfiles;
-# Auxiliary file descriptors, to close
-my @auxfds;
-
# Pids, to waid for
my @pids;
@@ -252,7 +249,7 @@ if ($filetype eq "PDF") {
my @pair = ($pid, @cmd);
push @pids, \@pair;
} else {
- *PSIN = *FIN;
+ open *PSIN, "<&FIN" or die "Can't dup: $!";
}
@@ -345,11 +342,8 @@ map { my ($pid, @cmd) = @$_;
} @pids;
-# Close auxiliary filehandles
-map {close} @auxfds;
-close READ or die "Can't close: $!";
-close FIN or die "Can't close: $!";
-close FOUT or die "Can't close: $!";
+map { close $_ or die "Can't close: $!" }
+ ( *READ, *FIN, *FOUT );
# Delete auxiliary files