Ok, but how can I check the age of file ? Because I need to "unlink" only files older than 7 days ...
Should I use something like : unlink $filename if(-M $filename > 7) José. -----Original Message----- From: Nigel Peck [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 10:15 AM To: [EMAIL PROTECTED]; NYIMI Jose (BMB) Subject: Re: Avoid using backticks You should be able to do it with opendir (to open directories and browse the contents) and unlink (to delete files) take a look at the man pages for those two to get you started, if you're still struggling just ask again. HTH Nigel >>> "NYIMI Jose (BMB)" <[EMAIL PROTECTED]> 07/29/02 08:37am >>> Hello, I would like to clean up my logfile directory by removing files that are older than 7 days. So I wrote something like: /user/local/bin/perl -w use strict; use FindBin qw($Bin); # `find $Bin -mtime +7 -name '*.log' -exec rm {} \;`; # __END__ My question is: how can I use perl's synthax instead of unix command "find" ? Thus avoid using backsticks. Thanks for your help. José. **** DISCLAIMER **** "This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer". Thank you for your cooperation. For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent. ITM Business Solutions Unit 4 Nine Trees Trading Estate Morthen Road Rotherham S66 9JG Reception Tel: 01709 703288 Fax: 01709 701549 Help Desk Tel:01709 530424 Fax: 01709 702159 CONFIDENTIALITY NOTICE: This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]