#!/usr/local/bin/perl
use strict;
use warnings;
system("cd $PATH
/usr/bin/sftp mysite.com <<!EOF
put sample.txt
bye
!EPF");
When i complile tha application, it asking the pasword,
how to pass the user/password in the code itself,
what i want is, my script should not ask the password. i want to set the user/password in the code itself.
user command not working in sftp
How to make it.
With such a vague question its hard to give more of an answer…
Have you tried the Net::SFTP module?
EDIT:
Based on the edit to the question – try using Net::SFTP::Foreign
You should get a more meaningful error message and you can take it from there.