From f8a3fac0ff78247d39abe6507c8f1b11fc9bd73b Mon Sep 17 00:00:00 2001 From: James Raspass Date: Thu, 31 Jul 2025 03:42:11 +0100 Subject: [PATCH] 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. --- lib/File/Copy.pm | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 1dc1d2d95c3a..9b2e12ead8f8 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -5,32 +5,29 @@ # Additions copyright 1996 by Charles Bailey. Permission is granted # to distribute the revised code under the same terms as Perl itself. -package File::Copy; +package File::Copy 2.42; + +use v5.40; +no warnings 'newline'; -use 5.035007; -use strict; -use warnings; no warnings 'newline'; -no warnings 'experimental::builtin'; -use builtin 'blessed'; use overload; use File::Spec; use Config; +use Exporter 'import'; + # We want HiRes stat and utime if available BEGIN { eval q{ use Time::HiRes qw( stat utime ) } }; -our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy); + sub copy; sub syscopy; sub cp; sub mv; -$VERSION = '2.41'; - -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(copy move); -@EXPORT_OK = qw(cp mv); +our @EXPORT = qw(copy move); +our @EXPORT_OK = qw(cp mv); -$Too_Big = 1024 * 1024 * 2; +our $Syscopy_is_copy; +our $Too_Big = 1024 * 1024 * 2; sub croak { require Carp; @@ -327,8 +324,6 @@ unless (defined &syscopy) { } } -1; - __END__ =head1 NAME @@ -508,6 +503,3 @@ filesystem(s). File::Copy was written by Aaron Sherman Iajs@ajs.comE> in 1995, and updated by Charles Bailey Ibailey@newman.upenn.eduE> in 1996. - -=cut -