use v5.10.1;
use strict;
use warnings;
+use File::Copy;
use parent 'Exporter';
-our @EXPORT_OK = qw(uniq numerically);
+our @EXPORT_OK = qw(uniq numerically cp);
sub uniq {
sub numerically { $::a <=> $::b }
+sub cp {
+ if ($File::Copy::VERSION >= 2.15) { # since Perl 5.11 we should have >= 2.15
+ return File::Copy::cp(@_);
+ }
+ copy(@_) or return undef;
+ my ($src, $dst) = @_;
+ my @st = stat $src or return undef;
+ chmod($st[2]&07777, $dst);
+}
+
1;
use Pod::Usage;
use Getopt::Long;
use FindBin qw'$RealBin';
-use File::Copy qw(cp);
use lib "$RealBin/lib";
use Exim::Runtest;
-use Exim::Utils qw(uniq numerically);
+use Exim::Utils qw(uniq numerically cp);
use if $ENV{DEBUG} && scalar($ENV{DEBUG} =~ /\bruntest\b/) => 'Smart::Comments' => '####';
use if $ENV{DEBUG} && scalar($ENV{DEBUG} =~ /\bruntest\b/) => 'Data::Dumper';