in reply to Net::SFTP. Script hangs. Bad repository?

I cleaned it up. Try this:
#!perl use strict; use warnings; use Net::SFTP; my $host = 'localhost'; my $user = 'user'; my $pass = 'password'; my %args = ( user => $user, password => $pass, port => 22, debug => 1 ); my $local = 'D:\\test.txt'; my $remote = '/dir1/dir2/test.txt'; my $sftp = Net::SFTP->new($host, %args); die "Can't put file: $!\n" unless $sftp->put($local, $remote); close $local;
Update: Fixed typo.