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:
- tier1 : webserver, running the CGI.
- tier2 : allows telnet from tier1, has the file of interest.
- tier3 : allows ftp from tier2, needs the file of interest.
Given that, I'd go with one of the following:
- 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
- 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.
- 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)