pdesh81 has asked for the wisdom of the Perl Monks concerning the following question:


hi all,

I have opened a telnet session from perl script, it looks like opended fine, but i am not able to see the FTP window, can any any one help me in keeping pined FTP window below is the script that i used

## -------------- use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/bash\$ $/'); $t->open("192.168.0.1"); $t->waitfor('/login: $/i'); $t->print('root'); $t->waitfor('/Password:$/i'); $t->print('root'); ##-------------------

Replies are listed 'Best First'.
Re: telnet session from perl scripts
by Corion (Patriarch) on Jun 17, 2011 at 08:04 UTC

    You never start the ftp program in your session.

    Did you maybe want to open a Net::FTP session to 192.168.0.1 instead of trying to launch the ftp program on 192.168.0.1?

    If you really want to transfer a file from/to 192.168.0.1 and a third machine, consider using a command line ftp client like wget or curl or GET from libwww-perl, or launch a Perl script on 192.168.0.1.

    Also, you should really consider using the ssh protocol, as it makes authentication much easier.