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
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
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
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