summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorTim Jenness <t.jenness@jach.hawaii.edu>2009-06-28 21:44:20 -1000
committerH.Merijn Brand <h.m.brand@xs4all.nl>2009-06-29 10:02:15 +0200
commitc3624cb8d7408c7bfe21b5f565063cc92cecfd19 (patch)
treee75554b9d02a06c999fb8407d799fbbe5edc0d21 /lib/File
parent74182dbd4562aa2e1f203924b0b5e6676faec47c (diff)
downloadperl-c3624cb8d7408c7bfe21b5f565063cc92cecfd19.tar.gz
tjenness: dual life modules
On Mon, 8 Jun 2009, Dave Mitchell wrote: > File::Temp > > blead and maint have some local portability fixes to > lib/File/Temp/t/fork.t, which is would be nice to see backported > to a new CPAN release. V0.22 is on its way to CPAN. Patch against blead is attached. This only includes the patch to fork.t rather than risking changes to Temp.pm itself. From e4eb4ee45a57b117f82541fbc66320112da228d4 Mon Sep 17 00:00:00 2001 From: Tim Jenness <t.jenness@jach.hawaii.edu> Date: Sun, 28 Jun 2009 21:41:14 -1000 Subject: [PATCH] Synchronize File::Temp with CPAN v0.22 Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Temp.pm4
-rw-r--r--lib/File/Temp/t/fork.t29
2 files changed, 16 insertions, 17 deletions
diff --git a/lib/File/Temp.pm b/lib/File/Temp.pm
index c0d7eefec2..a2d4ae0759 100644
--- a/lib/File/Temp.pm
+++ b/lib/File/Temp.pm
@@ -203,7 +203,7 @@ Exporter::export_tags('POSIX','mktemp','seekable');
# Version number
-$VERSION = '0.21';
+$VERSION = '0.22';
# This is a list of characters that can be used in random filenames
@@ -2387,7 +2387,7 @@ the C<tempdir> function.
Tim Jenness E<lt>tjenness@cpan.orgE<gt>
-Copyright (C) 2007-2008 Tim Jenness.
+Copyright (C) 2007-2009 Tim Jenness.
Copyright (C) 1999-2007 Tim Jenness and the UK Particle Physics and
Astronomy Research Council. All Rights Reserved. This program is free
software; you can redistribute it and/or modify it under the same
diff --git a/lib/File/Temp/t/fork.t b/lib/File/Temp/t/fork.t
index a522ca75a4..fd3f5a6f3c 100644
--- a/lib/File/Temp/t/fork.t
+++ b/lib/File/Temp/t/fork.t
@@ -6,25 +6,25 @@ $| = 1;
use strict;
BEGIN {
- require Config;
- my $can_fork = $Config::Config{d_fork} ||
- (($^O eq 'MSWin32' || $^O eq 'NetWare') and
- $Config::Config{useithreads} and
- $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
- );
- if ( $can_fork ) {
- print "1..8\n";
- } else {
- print "1..0 # Skip No fork available\n";
- exit;
- }
+ require Config;
+ my $can_fork = $Config::Config{d_fork} ||
+ (($^O eq 'MSWin32' || $^O eq 'NetWare') and
+ $Config::Config{useithreads} and
+ $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
+ );
+ if ( $can_fork ) {
+ print "1..8\n";
+ } else {
+ print "1..0 # Skip No fork available\n";
+ exit;
+ }
}
use File::Temp;
# OO interface
-my $file = File::Temp->new(CLEANUP=>1);
+my $file = File::Temp->new();
myok( 1, -f $file->filename, "OO File exists" );
@@ -60,7 +60,7 @@ myok( 4, -f $file->filename(), "OO File exists in parent" );
# non-OO interface
-my ($fh, $filename) = File::Temp::tempfile();
+my ($fh, $filename) = File::Temp::tempfile( UNLINK => 1 );
myok( 5, -f $filename, "non-OO File exists" );
@@ -88,7 +88,6 @@ while ($children) {
$children--;
}
myok(8, -f $filename, "non-OO File exists in parent" );
-unlink($filename); # Cleanup
# Local ok sub handles explicit number