Created
November 3, 2017 14:39
-
-
Save afresh1/814959ebfa171de0fda73f776b355c29 to your computer and use it in GitHub Desktop.
Forces File::Copy to use HiRes times in move.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use v5.20;; | |
use warnings; | |
BEGIN { | |
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