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
> 
> 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 highest suffix so I can go and do some 
>other stuff with it.
> 
> I have tried lots of different things but to no significant outcome.
> 
> Any suggestions?
> 
> Thanks
> 
> Ken
> 
> --
> 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]

Reply via email to