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


in reply to Re^4: Doing an 'ls' in SFTP:Foreign
in thread Doing an 'ls' in SFTP:Foreign

I suggest realizing that it returns a reference to an array of hashrefs. If you don't know what that is, read the docs that I've already linked to. You must deference the result to achieve the result you desire. There are even examples within this thread of posts somewhere. Example:
my $result = $sftp->ls(...); foreach my $f (@$result) { ... }