in reply to How to delet file on last 3 month ? ....

Based on some cases here, I was found this solution....
my $tf = (stat("$fdir/$file"))[9]; my $tt = time() - (86400 * 90); if ( $tf < $tt ) { unlink "$fdir/$file"; }
But, If you have some better ideas, Pleased advised me, I am very appreciated about that.... Thank you,

Replies are listed 'Best First'.
Re: Re: How to delet file on last 3 month ? ....
by ysth (Canon) on Jan 13, 2004 at 17:55 UTC
    If 3 months from the starting time of your program will work (instead of 3 months from the moment you are considering deleting the file), you can use -M, which subtracts script-start-time and converts to days for you:
    unlink "$fdir/$file" if 90 > -M "$fdir/$file";
    See perldoc -f -M