in reply to Epoch mod time for files

I threw Rhose's cool little example above into a while loop to read all files in a given directory, and print out age. Hope this helps.
#!/usr/bin/perl -w use strict; #-- Use modules use File::stat; use Time::Local; use Time::localtime; #-- Define local constants #-- Define local variables my $lNow; my $lStat; my $file; my $dirname; if($ARGV[0]){$dirname = $ARGV[0]}else{$dirname = "./";} opendir(DIR,$dirname) || die "Horrible Death"; while(defined($file=readdir(DIR))) { #-- Initialize variables $lNow=localtime(); $lNow=timelocal($lNow->sec,$lNow->min,$lNow->hour,$lNow->mday,$lNow->m +on,$lNow->year); #-- Process all files #-- Get the file's status $lStat=stat($file) || die 'Could not stat file ['.$file.']...'; #-- Print the time print $file,"\t",($lNow-$lStat->mtime()),' seconds old',"\n"; } closedir(DIR); #-- End of Script


Glenn Hefley
webadept.net