use strict; use warnings; use File::Copy 'copy'; use Test::More tests => 1; my $longname = 'foo_' . ('z' x 200); open my $fh, '>', $longname; print $fh "Hello!\n"; close $fh; my $toname = 'bar_' . ('z' x 200); ok copy ($longname, $toname) or diag $!;