My code involves going to a host(doing with openSSH), getting the list of files matching a pattern(doing using remote find command-OpenSSH) and then opening each file I have got and processing each(grepping etc). I am done with getting the file names and passing to a function. Now, I have to pass these filename to a function where I open each and process it. I am trying to do it using File::Remote as follows:
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...
But I am unable to open the file on the host an I am getting an error.