diff options
author | Mikhail Zabaluev <mhz@alt-linux.org> | 2001-10-23 14:40:37 +0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-23 11:47:19 +0000 |
commit | 008d9c33675aa00e42b5f6fb7c669165487b9dc5 (patch) | |
tree | 10675af18927b37e27d7c50f071a8faea79a7f77 /utils | |
parent | 45657e91a1533c5f70fa5f83ad180352afdbfd3c (diff) | |
download | perl-008d9c33675aa00e42b5f6fb7c669165487b9dc5.tar.gz |
one more touch on File::Temp
Message-ID: <20011023104037.A12761@localhost.localdomain>
(#12406 replaced with this)
p4raw-id: //depot/perl@12600
Diffstat (limited to 'utils')
-rw-r--r-- | utils/perldoc.PL | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 7f8216a006..1d64faf7ea 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -385,18 +385,6 @@ sub page { } } -sub cleanup { - my @files = @_; - for (@files) { - next unless defined; - if ($Is_VMS) { - 1 while unlink($_); # XXX: expect failure - } else { - unlink($_); # or die "Can't unlink $_: $!"; - } - } -} - my @found; foreach (@pages) { if ($podidx && open(PODIDX, $podidx)) { @@ -585,34 +573,14 @@ EOD } } -# until here we could simply exit or die -# now we create temporary files that we have to clean up -# namely $tmp, $buffer -# that's because you did it wrong, should be descriptor based --tchrist - -my $tmp; -my $tmpfd; -my $buffer; - require File::Temp; -($tmpfd, $tmp) = File::Temp::tempfile(); - -# make sure cleanup called -eval q{ - sub END { cleanup($tmp, $buffer) } - 1; -} || die; - -# exit/die in a windows sighandler is dangerous, so let it do the -# default thing, which is to exit -eval q{ use sigtrap qw(die INT TERM HUP QUIT) } unless $^O eq 'MSWin32'; +my ($tmpfd, $tmp) = File::Temp::tempfile(UNLINK => 1); my $filter; if (@pod) { - my $buffd; - ($buffd, $buffer) = File::Temp::tempfile(); + my ($buffd, $buffer) = File::Temp::tempfile(UNLINK => 1); print $buffd "=over 8\n\n"; print $buffd @pod or die "Can't print $buffer: $!"; print $buffd "=back\n"; |