#!/usr/bin/perl -w use strict; system ("ls"); print "file? "; chomp (my $file = <>); my $lockfile_epoch = (stat($file))[9]; my $current_epoch = time(); my $sttime = $current_epoch - $lockfile_epoch; # using stat print "$sttime\n"; my $fttime = (-M $file)*24*3600; # using file test print "$fttime\n";