From 14c3f3400cd81ac1cc95d87072aebca1e18c28c0 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 26 Sep 2010 21:29:13 +0200 Subject: ... or die "Can't close: $\!'" --- pdftool.pl | 12 +++--------- 1 file 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 -- cgit v1.2.3