summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-07-15 02:22:03 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-07-15 02:22:03 +0000
commit48a5c3991750705ae60f8e453b03b10a5bcb0d05 (patch)
tree8196b11d9dd9dea168d386f97eabe36afa385af5 /lib
parent7e2183d3f377ea6dfe14bac801f05b767231844b (diff)
downloadperl-48a5c3991750705ae60f8e453b03b10a5bcb0d05.tar.gz
perl 5.003_01: lib/File/Copy.pm
Change handling of $\ to avoid uninitializd variable warning when it was undefined
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Copy.pm7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
index 6846013010..aedcd7fb03 100644
--- a/lib/File/Copy.pm
+++ b/lib/File/Copy.pm
@@ -31,13 +31,11 @@ sub copy {
my $from = shift;
my $to = shift;
- my $recsep = $\;
my $closefrom=0;
my $closeto=0;
my ($size, $status, $r, $buf);
local(*FROM, *TO);
-
- $\ = '';
+ local($\) = '';
if (ref(\$from) eq 'GLOB') {
*FROM = $from;
@@ -81,7 +79,7 @@ sub copy {
goto fail_inner unless(defined($r));
close(TO) || goto fail_open2 if $closeto;
close(FROM) || goto fail_open1 if $closefrom;
- $\ = $recsep;
+ # Use this idiom to avoid uninitialized value warning.
return 1;
# All of these contortions try to preserve error messages...
@@ -100,7 +98,6 @@ sub copy {
$! = $status unless $!;
}
fail_open1:
- $\ = $recsep;
return 0;
}