develooper Front page | perl.perl5.porters | Postings from May 2008

[PATCH lib/File/Copy.pm] Use 3-arg open.

Thread Next
From:
Abigail
Date:
May 6, 2008 08:38
Subject:
[PATCH lib/File/Copy.pm] Use 3-arg open.
Message ID:
20080506153828.GA27662@abigail.be

This patch make File::Copy use 3-arg open instead of 2-arg open with 
magical NUL characters.


Abigail

--- lib/File/Copy.pm.orig	2008-05-06 17:26:03.000000000 +0200
+++ lib/File/Copy.pm	2008-05-06 17:27:00.000000000 +0200
@@ -163,7 +163,7 @@
     } else {
 	$from = _protect($from) if $from =~ /^\s/s;
        $from_h = \do { local *FH };
-       open($from_h, "< $from\0") or goto fail_open1;
+       open $from_h, "<", $from or goto fail_open1;
        binmode $from_h or die "($!,$^E)";
 	$closefrom = 1;
     }
@@ -182,7 +182,7 @@
     } else {
 	$to = _protect($to) if $to =~ /^\s/s;
        $to_h = \do { local *FH };
-       open($to_h,"> $to\0") or goto fail_open2;
+       open $to_h, ">", $to or goto fail_open2;
        binmode $to_h or die "($!,$^E)";
 	$closeto = 1;
     }

Thread Next


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