我想读取Ubuntu的机器在同一个局域网内远程主机(Ubuntu的)上/根目录下放置一个文件(TEMP.TXT)。(SSH和FTP是开放的)的Perl脚本是能够连接并出现OpenSSH的对话框询问密码,然后程序exists.Please人helps..below是我的脚本。
use POSIX qw(strftime);
use strict;
use warnings;
use File::Remote;
my $remote = new File::Remote;
# Standard filehandles
$remote->open(FILE, ">>X.X.X.X:/root/temp.txt") or die $!;
print FILE "Here's a line that's added.\n";
$remote->close(FILE);
执行时,我得到下面的错误。
Bareword "FILE" not allowed while "strict subs" in use at /root/Desktop/test.pl line 10.
Bareword "FILE" not allowed while "strict subs" in use at /root/Desktop/test.pl line 12.
Execution of /root/Desktop/test.pl aborted due to compilation errors.