my $until = time - 5 * 60; $sftp->mget($filemask, $dest, wanted => sub { $_[1]->{a}->mtime < $until });