develooper Front page | perl.perl5.changes | Postings from November 2010

[perl.git] branch blead, updated. v5.13.7-174-g71f155b

From:
brian d foy
Date:
November 28, 2010 12:05
Subject:
[perl.git] branch blead, updated. v5.13.7-174-g71f155b
Message ID:
E1PMnUn-0001z7-Dy@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/71f155bffeaddb2eb47b6eeacc004116b3de1bb6?hp=cbeaa189514a121fd71c6b4fb40c0bee7598a3d3>

- Log -----------------------------------------------------------------
commit 71f155bffeaddb2eb47b6eeacc004116b3de1bb6
Author: brian d foy <brian.d.foy@gmail.com>
Date:   Sun Nov 28 13:35:43 2010 -0600

    perlfaq5: How do I make a temporary file name?
    
         Fixed up a half-completed change from typeglobs to lexical
         filehandles.
-----------------------------------------------------------------------

Summary of changes:
 pod/perlfaq5.pod |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pod/perlfaq5.pod b/pod/perlfaq5.pod
index 4fcf337..1866a03 100644
--- a/pod/perlfaq5.pod
+++ b/pod/perlfaq5.pod
@@ -448,12 +448,12 @@ temporary files in one process, use a counter:
 	my $base_name = sprintf "%s/%d-%d-0000", $temp_dir, $$, time;
 
 	sub temp_file {
-		local *FH;
+		my $fh;
 		my $count = 0;
-		until( defined(fileno(FH)) || $count++ > 100 ) {
+		until( defined(fileno($fh)) || $count++ > 100 ) {
 			$base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
 			# O_EXCL is required for security reasons.
-			sysopen my($fh), $base_name, O_WRONLY|O_EXCL|O_CREAT;
+			sysopen $fh, $base_name, O_WRONLY|O_EXCL|O_CREAT;
 			}
 
 		if( defined fileno($fh) ) {

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About