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


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

Not a HASH reference at /root/backup/backswitch.pl line 20.
foreach $i ($sftp->ls(".")){ $fname=$i->{filename};

As per the documentation, $sftp->ls returns a reference to a list, not a list.