in reply to read directory

Here is a quick example using glob, map, and sort to produce a list of files and their modified times. It's not quite a Swartzian transform, because we leave the modified time hanging around for the output.
#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); my %cache = (); my @files = sort { $b->[1] <=> $a->[1] } map { [ $_, (stat($_))[9] ] } glob('pending/*'); print header; print "<table>\n"; for my $file (@files) { print "<tr><td>$file->[0]</td><td>" . localtime( $file->[1] ) . "</td></tr>\n"; } print "</table>\n";
also in the future, put <code></code> around code you post :)

-biz-