in reply to Getting latest modified file in a directory

perl -E "say+(sort{(stat$a)[9]<=>(stat$b)[9]}grep{-f}glob'*')[-1]"

L*

PS sorry.. the latest is indexed -1 not 0 which is the oldest

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.