http://www.perlmonks.org?node_id=1061456

mytutorial has asked for the wisdom of the Perl Monks concerning the following question:

I need to retrieve files from a directory on a remote server that are at least 5 minutes old. I am using Net::SFTP::Foreign in my Perl script. The array @directory_info contains the directory path and the filemask. I am pulling the files from the remote server using $sftp->glob. How can I only get the files that are at least 5 minutes old using $sftp->glob? The $sftp->glob portion from my script is below.

while($i < 11) { $directory = "$directory_info[$i][0]"; $filemask = "$directory_info[$i][1]"; $sftp->setcwd($directory) or $newerr=1; @list = $sftp->glob("$filemask") or $newerr=1; } $i++;

Thank you for your time and help!