1
우분투 컴퓨터에서 동일한 LAN에있는 원격 호스트 (우분투)의/root 디렉토리 아래에있는 파일 (temp.txt)을 읽으려고합니다 (ssh 및 ftp가 열려 있음) 펄 스크립트가 연결이 가능하고 OpenSSH 대화 상자가 나타나 암호를 물어 본 다음 프로그램이 존재합니다. 제발 아무도 도와 줄 수 없습니다. 내 스크립트는 다음과 같습니다.perl을 사용하여 원격 호스트에서 파일 읽기
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.