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.
Back to
Seekers of Perl Wisdom