in reply to Sort files by oldest timestamp

You have some "brain twisting" stuff here.

First, I would suggest using /, forward slash instead of \\. This is portable and will work on Windows.

Now, what do you you think this does?

opendir(DIR, $srcdir) or die "Can't open $srcdir: $!"; my @files = grep {!/^\.+$/} readdir(DIR);
This looks pretty good, but readdir doesn't give a full path..@files is just some names within the $srcdir. If you want to use @files, and do some kind of a test like -M, you will need to prepend the $srcdir to get a full path name!

Replies are listed 'Best First'.
Re^2: Sort files by oldest timestamp
by Anonymous Monk on May 07, 2009 at 05:40 UTC
    Thank you everyone who responded with answers.As Marshall said,the issue is not having full path.My issue is resolved after prepend the $srcdir to get a full path name. Thank you for the help!.