<p>Is there an elegant way in Perl to find the newest file in a directory (newest by modification date)?</p>

<p>What I have so far is searching for the files I need, and for each one get it's modification time, push into an array containing the filename, modification time, then sort it.</p>

<p>There must be a better way.</p>

you could try using the shell's
```
ls
```
command:
```
```
@list = `ls -t`;
$newest = $list[0];
```
```