On Wed, 2004-05-12 at 02:18, Joseph Ruffino wrote: > Hi, > > I have a question that maybe someone can help me with. I am > writing/creating a file on a unix server, and I check to see if the file > exists before I create it. If it does create a new file, I want to send > the previous file via e-mail to a specific person. > > I currently have it working for the previous day, I use the date for the > filename. But, what if the day before is not the previous file? I want > to code something that will either, check the date on the file, or find > the previous file, whether it be the day before, i.e. 051104.txt to > 051204.txt or some day distant, i.e. 050804.txt to 051204.txt. > > I hope I am explaining myself correctly, feel free to ask as many > questions you can if i have explained myself well enough.
So I assume you know the name of the file. You can use modules like File::Find But sometimes it is must better to use system commands like $file=`find $srcdir -name $filename -print` ( Of course I assume you are using a unix like machine ) Bye Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>