Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Forces File::Copy to use HiRes times in move.
use v5.20;;
use warnings;
require Time::HiRes;
# Has to come before importing File::Copy
Time::HiRes->export( 'File::Copy', qw( stat utime ) );
use File::Copy;
open my $fh, '>out' or die $!;
say $fh "hai";
close $fh;
say [ File::Copy::stat('out') ]->[9];
File::Copy::move("out", "$ENV{HOME}/out");
say [ File::Copy::stat("$ENV{HOME}/out") ]->[9];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment