in reply to retrieve file with latest date stamp

I'd use:
my $last_modified = (`ls -t`)[0];