I want to write one perl script “a.pl” which will run on Local Machine “A”. This script “a.pl” will execute some unix command and check timestamp of log files on Remote Machine “B”. I also want to run “for” loop and text filtering/formatting on log files of Remote Server. I want to import all the output of remote unix commands and outcome of text processing of remote log files into my local perl script “a.pl”, So that I can generate a report and email it.
I can use Net::OpenSSH to execute unix command on remote server. But I don’t know how I am going to use “for” loop on remote machine to process all the log files in different directories. The problem is If I use Bash shell “for” loop then my local Perl script “a.pl” will give syntax error and if I use perl “for” loop then I got bash –c syntax error. Another big problem is if everything goes fine than how to import variables and output to my local perl script