in reply to older files

Am I missing something? Why not just do:
my $three_days = 86400 * 3; my $mtime = (stat $temp1)[9]; if (time - $mtime > $three_days) { print " OLDER 3 days"; }

Replies are listed 'Best First'.
Re^2: older files
by Selvakumar (Scribe) on Aug 04, 2009 at 07:38 UTC
    i tried that and it's not worked for me. I don't know why. I got the solution using the below way. Thanks for the reply.
    my $mtime = (stat "$temp1") [9]; my $older=60*60*24; my $diff=$today-$mtime; $diff=$diff/$older; print " DIFF $diff "; if ($diff >3)

      No need for the date calculation, the -M operator already does that for you:

      print "Old\n" if -M $temp1 > 3;
      -derby