Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
open FILES1, "ls *|" or die "Can not run ls $!\n"; while (<FILES1>) { my $time1=time(); my $mtime = (stat ($_))[9] or die "Stat problem on $_: $!\n"; my $age_hours=($time1 - $mtime) / 3600 ; my $age_days= $age_hours/24; print "Got time $mtime hours: $age_hours days: $age_days \n"; } close FILES1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange problem with stat
by valdez (Monsignor) on Feb 14, 2004 at 14:52 UTC | |
|
Re: Strange problem with stat
by VSarkiss (Monsignor) on Feb 14, 2004 at 17:20 UTC | |
|
Re: Strange problem with stat
by ctilmes (Vicar) on Feb 14, 2004 at 17:40 UTC | |
|
Re: Strange problem with stat
by tachyon (Chancellor) on Feb 14, 2004 at 20:13 UTC | |
|
Re: Strange problem with stat
by CountZero (Bishop) on Feb 14, 2004 at 16:37 UTC | |
|
Re: Strange problem with stat
by pelagic (Priest) on Feb 14, 2004 at 15:54 UTC |