in reply to What's the difference between stat and sort?
Perhaps there are no files in the directory where you tried you second snippet?
Try this in any *nix box:
perl -e 'my $lf = (sort(</bin/*>))[-1];print $lf' [download]