Smaug has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm trying to get the newest file in a Win32 directory. I have done it as follows:
Also, is there a module I should know about for these sorts of things??
Thanks,
Smaug.
I'm trying to get the newest file in a Win32 directory. I have done it as follows:
Although this works, I am sure that there is a better way of doing this?!?@list=(`dir *.log \/B \/OD`); $count = scalar(@list); $newest = $list[$#count]; print "$newest \n";
Also, is there a module I should know about for these sorts of things??
Thanks,
Smaug.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Return newest file
by chromatic (Archbishop) on Aug 13, 2003 at 06:16 UTC | |
Re: Return newest file
by cchampion (Curate) on Aug 13, 2003 at 10:36 UTC | |
by snax (Hermit) on Aug 13, 2003 at 20:29 UTC | |
Re: Return newest file
by AcidHawk (Vicar) on Aug 13, 2003 at 06:25 UTC |
Back to
Seekers of Perl Wisdom