Change 32735 by [EMAIL PROTECTED] on 2007/12/26 17:06:04
Upgrade to File-Temp-0.20
Affected files ...
... //depot/perl/lib/File/Temp.pm#37 edit
... //depot/perl/lib/File/Temp/t/lock.t#4 edit
Differences ...
==== //depot/perl/lib/File/Temp.pm#37 (text) ====
Index: perl/lib/File/Temp.pm
--- perl/lib/File/Temp.pm#36~32652~ 2007-12-19 07:19:41.000000000 -0800
+++ perl/lib/File/Temp.pm 2007-12-26 09:06:04.000000000 -0800
@@ -203,7 +203,7 @@
# Version number
-$VERSION = '0.19';
+$VERSION = '0.20';
# This is a list of characters that can be used in random filenames
==== //depot/perl/lib/File/Temp/t/lock.t#4 (text) ====
Index: perl/lib/File/Temp/t/lock.t
--- perl/lib/File/Temp/t/lock.t#3~32666~ 2007-12-20 02:41:52.000000000
-0800
+++ perl/lib/File/Temp/t/lock.t 2007-12-26 09:06:04.000000000 -0800
@@ -6,17 +6,19 @@
use Fcntl;
BEGIN {
- # see if we have O_EXLOCK
- eval { &Fcntl::O_EXLOCK; };
- if ($@) {
- plan skip_all => 'Do not seem to have O_EXLOCK';
- } else {
- plan tests => 4;
- }
-
- use_ok( "File::Temp" );
+# see if we have O_EXLOCK
+ eval { &Fcntl::O_EXLOCK; };
+ if ($@) {
+ plan skip_all => 'Do not seem to have O_EXLOCK';
+ } else {
+ plan tests => 4;
+ use_ok( "File::Temp" );
+ }
}
+# Need Symbol package for lexical filehandle on older perls
+require Symbol if $] < 5.006;
+
# Get a tempfile with O_EXLOCK
my $fh = new File::Temp();
ok( -e "$fh", "temp file is present" );
@@ -29,7 +31,9 @@
eval {
local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
alarm $timeout;
- $status = sysopen(my $newfh, "$fh", $flags, 0600);
+ my $newfh;
+ $newfh = &Symbol::gensym if $] < 5.006;
+ $status = sysopen($newfh, "$fh", $flags, 0600);
alarm 0;
};
if ($@) {
@@ -44,7 +48,9 @@
eval {
local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
alarm $timeout;
- $status = sysopen(my $newfh, "$fh", $flags, 0600);
+ my $newfh;
+ $newfh = &Symbol::gensym if $] < 5.006;
+ $status = sysopen($newfh, "$fh", $flags, 0600);
alarm 0;
};
if ($@) {
End of Patch.