in reply to Re: how to list the files in dir with respect to time
in thread how to list the files in dir with respect to time
Regarding OP's question about finding the modification time, in addition to stat, also worth knowing about File::stat for a more readable wrapper and not having to remember or lookup that 9 means mtime.
map { [ $_, stat($_)->mtime ] }
This is, of course, an efficiency/readability tradeoff, but this may be acceptable in many cases.
OP may want to see Understanding transformation sorts (ST, GRT), the details if unfamiliar with the Schwartzian Transform<./p>
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|