xingjin3131 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl if(opendir LOGS, "D:\\Log\\tmp"){ my @myfile = grep( /^*.tmp$/, readdir (LOGS)); foreach $file(@myfile){ my $result=-M $file; if( $result> 7){ unlink ($file); } } } closedir LOGS;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why -M doesn't work?
by Tanktalus (Canon) on Feb 07, 2008 at 23:06 UTC | |
by xingjin3131 (Novice) on Feb 15, 2008 at 15:41 UTC | |
|
Re: Why -M doesn't work?
by runrig (Abbot) on Feb 07, 2008 at 23:01 UTC | |
by xingjin3131 (Novice) on Feb 15, 2008 at 15:40 UTC | |
|
Re: Why -M doesn't work?
by jrsimmon (Hermit) on Feb 07, 2008 at 23:02 UTC | |
|
Re: Why -M doesn't work?
by GrandFather (Saint) on Feb 07, 2008 at 23:11 UTC | |
by xingjin3131 (Novice) on Feb 15, 2008 at 15:45 UTC | |
|
Re: Why -M doesn't work?
by Joost (Canon) on Feb 08, 2008 at 00:15 UTC | |
|
Re: Why -M doesn't work?
by poolpi (Hermit) on Feb 08, 2008 at 08:01 UTC | |
by ysth (Canon) on Feb 08, 2008 at 09:16 UTC | |
by xingjin3131 (Novice) on Feb 15, 2008 at 15:44 UTC |