我的代码涉及到一个主机(使用openSSH),获取匹配模式的文件列表(使用远程查找命令OpenSSH),然后打开每个文件并获得并处理(grepping等)。 我已完成获取文件名并传递给函数。现在,我必须将这些文件名传递给我打开并处理它的函数。我试图用文件如下做到这一点::远程:在远程主机上读取文件
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...
但我无法打开主机上的文件中,我得到一个错误。
你有什么问题? – AbhiNickz
它说找不到File/Remote.pm – emma
你配置了File :: remote perl模块吗? – RAFA