Thanks very much Ken, Ken, Dan, Matt, Sherm and Jarkko for
your excellent examples!  I really appreciate the time
you've taken to share your code.

Hope you don't mind, but I have a few more questions.  I've
been researching through my Perl books and think I
understand how most of the code below works, but I can't
seem to make it work with my test folder items.  Here's what
I'm running:

opendir(DIR, shift || "/Users/jay/Desktop/Other Stuff/old
stuff 4") && print map { "$_->[1]\n" } sort { $a->[0] <=>
$b->[0] || $a->[1] cmp $b->[1] } map { [ (stat($_))[9], $_ ]
} grep { !/^\.{1,2}$/ } readdir(DIR)

The different types of errors I'm getting are:

�  Argument (file name) isn't numeric in numeric
comparison (<=>)
�  (62) Use of uninitialized value in string comparison
(cmp)

(I'm running this code in 'Affrus' on OS 10.3.3)

--

I'm also curious how 'grep' works in here.  If I'm
understanding part of it right, it looks like 'grep' is
pulling just the lines (from the file names that have been
read in) that don't start with a period.  But I'm not sure
how {1,2}$ works in there?

Thanks again for your help.

Jay

Reply via email to