in reply to Net::SFTP error

  1. use warnings; use strict;
  2. debug => 1
  3. protocol and port are not valid args, read the docs

You might do well to read through the example that ships with the module. (snippet follows)

my %args = (ssh_args => []); $args{debug} = 1 if $opts{v}; push @{ $args{ssh_args} }, compression => 1 if $opts{C}; print "Connecting to $host...\n"; my $sftp = Net::SFTP->new($host, %args);

The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. -- Cyrus H. Gordon