>>>>> "Todd" == Todd W <[EMAIL PROTECTED]> writes:

Todd> my @files = map $_->[0],
Todd>      sort { $b->[1] <=> $a->[1] }
Todd>      map [ $_, -M ],
Todd>      grep -f,                 # get only plain files
Todd>      glob("/mnt/qdls/MSDSIN/*");

Since the map can also serve as a grep, and we can use the _ handle
to avoid stat'ing twice, this can be simplified to:

my @files =
  map $_->[0],
  sort { $b->[1] <=> $a->[1] }
  map { -f $_ ? [$_, -M _] : () }
  glob "...";

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to