Re: Getting A File Name

2002-10-18 Thread Jean Padilla
Hi, try this : my $last = (glob("fred.*"))[-1]; --- - $last gets the last item in the array returned by glob() - glob() returns file names sorted alphabetically ;-) Regards. Ken Cole a écrit : > > Hi, > > I have a directory in which there are files such as: > > fred.1 > fred.2 > fred.3 > > T

Re: Getting A File Name

2002-10-16 Thread John W. Krahn
Ken Cole wrote: > > Hi, Hello, > I have a directory in which there are files such as: > > fred.1 > fred.2 > fred.3 > > The suffix increases and older files get deleted so there are always 3 fred.* > files in the directory at any one time. > > I need to get the name of the file with the highe

RE: Getting A File Name

2002-10-16 Thread Ken Cole
Thanks Vinai, For the code and the explanations. Ken > -Original Message- > From: vinai AR [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 17, 2002 1:54 PM > To: Ken Cole; [EMAIL PROTECTED] > Subject: RE: Getting A File Name > > > I think this script will

RE: Getting A File Name

2002-10-16 Thread vinai AR
I think this script will help u. Assume that u r in the directory where u have these three files.(If not use chdir and move to that directory). @file_List = On executing the above statement @file_List will have all the three files fred.*. map {$_ =~ s/fred.//} @file_List The above statement r