code_junkie

How can I compare file creation time to the current time in Perl?

Nov 13th, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. 22116291110813630
  2.  
  3. Today, December 29, 2008, 2:38:37 PM
  4.  
  5. ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  6. $atime,$mtime,$ctime,$blksize,$blocks)
  7. = stat($filename);
  8.  
  9. $mtime = ( stat $filename )[9];
  10. $current_time = time;
  11.  
  12. $diff = $current_time - $mtime;
  13.  
  14. $mtime = ( stat $filename )[9];
  15. $current_time = time;
  16.  
  17. $diff = $current_time - $mtime;
  18.  
  19. my $diff = -M $filename;
Add Comment
Please, Sign In to add comment