diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-07-15 02:22:03 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-07-15 02:22:03 +0000 |
commit | 48a5c3991750705ae60f8e453b03b10a5bcb0d05 (patch) | |
tree | 8196b11d9dd9dea168d386f97eabe36afa385af5 /lib | |
parent | 7e2183d3f377ea6dfe14bac801f05b767231844b (diff) | |
download | perl-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.pm | 7 |
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; } |