Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PERL:无法在FTP模式下执行cwd_Perl_Ftp_Cd_Cwd - Fatal编程技术网

PERL:无法在FTP模式下执行cwd

PERL:无法在FTP模式下执行cwd,perl,ftp,cd,cwd,Perl,Ftp,Cd,Cwd,我无法在FTP模式下将cd刻录到远程计算机上的路径。请告知 if (! $sftp->cwd($tgt)) { $error = $sftp->error; #print ("Unable to cd to $tgt: $error\n"); print ("$error\n"); logmsg("Unable to cd to $tgt: $error\n"); mailmsg("Unable to cd to $tgt: $error\n"

我无法在FTP模式下将cd刻录到远程计算机上的路径。请告知

if (! $sftp->cwd($tgt)) {
    $error = $sftp->error;
    #print ("Unable to cd to $tgt: $error\n");
    print ("$error\n");
    logmsg("Unable to cd to $tgt: $error\n");
    mailmsg("Unable to cd to $tgt: $error\n");
   myExit();
} else {
    print ("Able to cd to $tgt: \n");
    logmsg("Able to cd to $tgt: \n");

}

我得到的错误仅为0。我在网上查过,0表示语法错误,但我个人不这么认为。

您使用的是哪个SFTP库?
$tgt
的值是多少?我的$sftp=Net::FTP->new($server,%args);什么是
$ftp->code()
$ftp->message()
?如果使用ftp,请不要命名变量
sftp
。这很混乱。
错误
是一种方法。您应该查看
消息的返回值
您使用的是哪个SFTP库?
$tgt
的值是多少?我的$sftp=Net::FTP->new($server,%args);什么是
$ftp->code()
$ftp->message()
?如果使用ftp,请不要命名变量
sftp
。这很混乱。
错误
是一种方法。您应该查看
消息的返回值