http://qs321.pair.com?node_id=1232424


in reply to Re: Modifying Script From Net::SFTP to Net::SFTP::Foreign
in thread Modifying Script From Net::SFTP to Net::SFTP::Foreign

yes, ls returns a reference in order to be able to signal errors. The usual idiom for using it is as follows:
my $ls = $sftp->ls(...) or die "ls failed: " . $sftp->error; for my $fn (@$ls) { ... }