I am new to perl and trying to create a FTP script using LFTP program.
I'm trying to execute a FTP script file through LFTP. My code is :
my $CLIENT = "lftp";
my $connectionString = "" . $CLIENT . " -d -f script.ftp";
my $result = `$connectionString` or die "\nERROR running $CLIENT: $!";
return $result;
Well, it's perfectly execute all command from script.ftp file as debug is on to see the output and after that just die and nothing written to $result.
Error I'm receiving is -
ERROR running lftp: at ftp.pl line 3.
It refers to line where I am passing the output to the variable $result.
Any clue why it's not passing the output to $result and just die?
If I run the same from Linux shell, it's perfectly executing with no error.