Blob


1 #!/usr/bin/perl
3 # Write a program to make a report of the access and modification
4 # times (in the epoch time) of the files in the current directory.
5 # Use stat to get the times, using a list slice to extract the
6 # elements. Report your results in three columns, like this:
7 #
8 # fred.txt 1294145029 1290880566
9 # barney.txt 1294197219 1290810036
10 # betty.txt 1287707076 1274433310
12 use v5.24;
13 use warnings;
14 use strict;
15 use utf8;
17 for (glob '.* *') {
18 my ($atime, $mtime) = (stat $_)[8,9];
19 printf "%-16s %d %d\n", $_, $atime, $mtime;
20 }