#!/usr/bin/perl use strict; use warnings; use Net::SFTP; # Set up the variables for the FTP. my $hostname = 'myhost'; my $sftp; our %args=( user => "myuser", password => "mypass", debug => 1 ); $sftp = Net::SFTP->new($hostname, %args); # close($sftp->{ssh}->sock()); print $sftp->status;