Maybe I'm reading your message incorrectly, but your labeling of the systems seems rather confusing (is tier1 the webserver running the CGI, or the host that you're telneting to?)

I'm going to go with the assumption that you're dealing with:

Given that, I'd go with one of the following:

  1. Continue on with the processes that you've started. Basically, you'd use the same 'waitfor' and 'print' in Net::Telnet to send the necessary commands to transfer the file between tier2 and tier3. If available, I'd recommend looking into using scp over FTP, just because the command is more easily scriptable. (rcp is another possibility, if security isn't an issue). You might also look into Expect for some better error handling in the connection
  2. If tier2 has FTP or some other form of file transfers available, and tier3 allowed FTP in from tier1, and the file is allowed on the network connected to tier1, I'd use Net::FTP to pull the file from tier2 to tier1, then push it up to tier3.
  3. If tier2 and tier3 allowed scp in from tier1, I'd use it instead (I've never used it to move between two remote systems, but the man page seems to suggest that's possible)

In reply to Re^3: FTP in TELNET by jhourcle
in thread FTP in TELNET by Spydaw

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.