Subject: | [PATCH] wrong return precedence |
returns binds stronger than or, so the expressions after or are ignored.
See https://rt.perl.org/rt3/Public/Bug/Display.html?id=59802
Subject: | File-Copy-Link-0.113-returnor.patch |
diff -bu File-Copy-Link-0.113-hsxeyo/lib/File/Copy/Link.pm~ File-Copy-Link-0.113-hsxeyo/lib/File/Copy/Link.pm
--- File-Copy-Link-0.113-hsxeyo/lib/File/Copy/Link.pm~ 2011-09-23 10:14:51.000000000 -0500
+++ File-Copy-Link-0.113-hsxeyo/lib/File/Copy/Link.pm 2013-07-23 15:48:34.533307228 -0500
@@ -17,7 +17,7 @@
croak "$_ not a link\n" unless -l;
open my $fh, '<', $_ or croak "Can't open link $_: $!\n";
unlink or croak "Can't unlink link $_: $!\n";
- return File::Copy::copy $fh, $_ or croak "copy($fh $_) failed: $!\n";
+ return File::Copy::copy($fh, $_) || croak "copy($fh $_) failed: $!\n";
}
sub safecopylink {
@@ -27,7 +27,7 @@
my $orig = File::Spec::Link->linked($_);
croak "$_ link problem\n" unless defined $orig;
unlink or croak "Can't unlink link $_: $!\n";
- return File::Copy::copy $orig, $_ or croak "copy($orig $_) failed: $!\n";
+ return File::Copy::copy($orig, $_) || croak "copy($orig $_) failed: $!\n";
}
1;