in reply to Re: Directory Listing
in thread Directory Listing
my $dir = shift || "."; my $field = shift || 10; opendir(DIRH, $dir) or die "Cannot open $dir: $!"; for ( sort { $b->[1], $a->[1] } map { [ $_, (stat("$dir/$_"))[$field] ] } grep { !/^\.\.?$/ && /pm$/ } readdir(DIRH) ) { print join("\t", @$_) . "\n"; } closedir(DIRH);
|
|---|