Hi Monks,

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

Thanks.

In reply to How to execute Perl code on remote machine from a local Perl script and process the output/variables in your local Perl script by dushyant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.