【发布时间】:2017-09-09 05:18:03
【问题描述】:
我的代码涉及到主机(使用 openSSH),获取与模式匹配的文件列表(使用远程查找命令-OpenSSH),然后打开我获得的每个文件并处理每个文件(grepping 等)。 我完成了获取文件名并传递给函数。现在,我必须将这些文件名传递给我打开每个文件名并处理它的函数。我正在尝试使用 File::Remote 进行如下操作:
sub processFiles{
my $fileList =shift;
#Iterate over the file and try to find start and stop time stamps from the file
for my $file ( @{$fileList}) {
#finding start time of file:its found in lines of file
my $HEAD;
open $HEAD, "host:head -1000 $File|" or die "Unable to check file for starting time";
while ( <$HEAD> ) {
#process...
但我无法在主机上打开文件,出现错误。
【问题讨论】:
-
您遇到了什么问题?
-
它说 Can't locate File/Remote.pm
-
你配置 File::remote perl 模块了吗?
-
@RAFA 我在我的代码中包含了
-
@emma 你需要使用 cpan 配置 File::remote perl 模块。
标签: perl unix ssh openssh remote-host