The file test operators -X -M will give you the modification time, so something like
my $last = ( sort {-M $a <=> -M $b} glob('*.rtf') )[0];
Do check the docs for glob, as it doesn't take a regex but a shell-like file match expression.
In reply to Re: How to find most recent file and use it?
by RichardK
in thread How to find most recent file and use it?
by luxlunae
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |