kellypayton
MIS
Hey ok i would appreciate any help you very helpful people can give me on this. below is the piece of code i use to display a list of all files within a folder. it displays them great but i want it to display them in the order they were last modified.
opendir THEDIR, "$config{'basepath'}/gigfiles" or &error("Unable to open directory: $!");
readdir THEDIR; readdir THEDIR;
my @allfiles = readdir THEDIR;
closedir THEDIR;
my $file;
foreach $file (sort @allfiles) {
$file =~ s/.dat$//;
That code reads all the files in the directory and then i use $file inside my output which displays them on the screen. What changes do i make to that code to display them in order of last modified please??
thank you in advance for any help you can offer. xx
opendir THEDIR, "$config{'basepath'}/gigfiles" or &error("Unable to open directory: $!");
readdir THEDIR; readdir THEDIR;
my @allfiles = readdir THEDIR;
closedir THEDIR;
my $file;
foreach $file (sort @allfiles) {
$file =~ s/.dat$//;
That code reads all the files in the directory and then i use $file inside my output which displays them on the screen. What changes do i make to that code to display them in order of last modified please??
thank you in advance for any help you can offer. xx