in reply to Re^2: Perl SFTP question?
in thread Perl SFTP question?

I naively assumed that the ls call returned a list of return results from the passed coderef, and having looked at the source I can't help wondering why the module writer didn't do that (the values just get dumped since it explicitly returns an empty array; I really don't understand that choice). I would say then the best choice is using a closure to export the data value. If the OP only wants the oldest value, a simple compare and drop would probably be best. Otherwise, he could use the closure to export an array of the mtime and longname values. He's already caching search results using a closure, so neither of those should be a challenge. Explicitly performing an element-by-element stat seems like excess. I will concede that it gains clarity.