Morning perl monks! Im just testing the waters here, im fairly new to perl. what I need to do is this: I will have a text file with 4000 IPs in it I need to go through this list as quickly as possible, for each IP I will start an SSH connection and run several commands and catch the stdout of the last command that will return a comma separated output which will need to include the IP and the output and put this into a CSV file ALL of the last commands output then need to go into one CSV file for all the IPs. I was thinking of loading the IP list into memory rather than cycling through it. I was thinking of then forking rather than full on threads and temporarily writing the forks output to a memory file (because forks accessing the same csv would cause problems) and then finally write the output to the csv. I also intend to use LOG4PERL to keep a track of things and another file for when SSH has failed to connect. The PC this will be run is a HP 4 core server with raid 5 drives. SO guys I would be grateful for some input to see how you would do this.

In reply to threads, forks and SSH by ralph2014

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.