I'm not sure if it's fast or not, but can you do a ls-t, grep the names, then print them?
Ex.
@x = `ls -t`;
foreach $x (@x)
{
print $x;
}
$asdf = <>;
That was pretty quick with like 20 files, I don't know the throughput for 1000's of files
I post the occasional Perl tip and or whatever I can think of that might be helpful to people that I had a hard time figuring out how to do at my blog
Onaclov Nation
onaclov2000
Junior Poster in Training
57 posts since Jun 2008
Reputation Points: 11
Solved Threads: 5
appreciate the help. I'm using a windows machine...will "ls" work on windows? haven't had a chance to try it yet...but i know ls doesn't work in the command shell
I ran into that question on another topic I was discussing with a co-worker, we suspect since i have cygwin setup that might be skewing my answer,
ALTHOUGH we should be able to use the dir command,
After checking out MSDN: MSDN
we find out:
/o [[:]SortOrder]
where:
d = By date and time, earliest first
I'm not at a windows machine at the moment, but it looks like you can replace ls -t with
dir /od
Good luck let me know how it works out,
If you want I have a few posts on Perl and some other various topics on my blog and you're welcome to check it out.
Onaclov Nation
onaclov2000
Junior Poster in Training
57 posts since Jun 2008
Reputation Points: 11
Solved Threads: 5