Skip to content

Commit 2d0e346

Browse files
JRaspasskhwilliamson
authored andcommitted
Modernise File::Copy a little
- Move the version declaration into the package line. - Use v5.40 to get strict, warnings, the blessed builtin, and the module_true feature. - Import Exporter's import rather than subclassing it.
1 parent 36f20a5 commit 2d0e346

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

lib/File/Copy.pm

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,29 @@
55
# Additions copyright 1996 by Charles Bailey. Permission is granted
66
# to distribute the revised code under the same terms as Perl itself.
77

8-
package File::Copy;
8+
package File::Copy 2.42;
9+
10+
use v5.40;
11+
no warnings 'newline';
912

10-
use 5.035007;
11-
use strict;
12-
use warnings; no warnings 'newline';
13-
no warnings 'experimental::builtin';
14-
use builtin 'blessed';
1513
use overload;
1614
use File::Spec;
1715
use Config;
16+
use Exporter 'import';
17+
1818
# We want HiRes stat and utime if available
1919
BEGIN { eval q{ use Time::HiRes qw( stat utime ) } };
20-
our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy);
20+
2121
sub copy;
2222
sub syscopy;
2323
sub cp;
2424
sub mv;
2525

26-
$VERSION = '2.41';
27-
28-
require Exporter;
29-
@ISA = qw(Exporter);
30-
@EXPORT = qw(copy move);
31-
@EXPORT_OK = qw(cp mv);
26+
our @EXPORT = qw(copy move);
27+
our @EXPORT_OK = qw(cp mv);
3228

33-
$Too_Big = 1024 * 1024 * 2;
29+
our $Syscopy_is_copy;
30+
our $Too_Big = 1024 * 1024 * 2;
3431

3532
sub croak {
3633
require Carp;
@@ -327,8 +324,6 @@ unless (defined &syscopy) {
327324
}
328325
}
329326

330-
1;
331-
332327
__END__
333328
334329
=head1 NAME
@@ -508,6 +503,3 @@ filesystem(s).
508503
509504
File::Copy was written by Aaron Sherman I<E<lt>[email protected]E<gt>> in 1995,
510505
and updated by Charles Bailey I<E<lt>[email protected]E<gt>> in 1996.
511-
512-
=cut
513-

0 commit comments

Comments
 (0)