From: Steve Peters Date: Wed, 26 Dec 2007 17:06:04 +0000 (+0000) Subject: Upgrade to File-Temp-0.20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a784fd7c04b5b7c80f2ffe634e5f2d348fbbad13;p=p5sagit%2Fp5-mst-13.2.git Upgrade to File-Temp-0.20 p4raw-id: //depot/perl@32735 --- diff --git a/lib/File/Temp.pm b/lib/File/Temp.pm index bd6c5f9..120b532 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.19'; +$VERSION = '0.20'; # This is a list of characters that can be used in random filenames diff --git a/lib/File/Temp/t/lock.t b/lib/File/Temp/t/lock.t index d08b94a..ff8c7f9 100644 --- a/lib/File/Temp/t/lock.t +++ b/lib/File/Temp/t/lock.t @@ -6,17 +6,19 @@ use strict; 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 @@ my $status; 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 @@ $fh = new File::Temp( EXLOCK => 0 ); 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 ($@) {