Subject: | [PATCH] tempfile clean-up |
There is some code in the DESTROY method to close tempfiles on Windows because they cannot
be unlinked while open. The exact same thing is necessary on VMS and the attached patch does
that. Before this patch, running the CGI test suite leaves a lot of crud in my temp directory.
After this, it's clean as a whistle.
Subject: | cgi_tempfile_cleanup.patch |
--- lib/CGI.pm;-0 2011-06-09 06:18:35 -0500
+++ lib/CGI.pm 2011-06-30 14:52:24 -0500
@@ -386,7 +386,7 @@ sub new {
# user is still holding any reference to them as well.
sub DESTROY {
my $self = shift;
- if ($OS eq 'WINDOWS') {
+ if ($OS eq 'WINDOWS' || $OS eq 'VMS') {
for my $href (values %{$self->{'.tmpfiles'}}) {
$href->{hndl}->DESTROY if defined $href->{hndl};
$href->{name}->DESTROY if defined $href->{name};